You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f6c0ed0
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/src/use/configure/migration-guide.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -369,7 +369,7 @@ You'll need to install the `globals` package from npm for this example to work.
369
369
### `eslint-env` Configuration Comments
370
370
371
371
In the eslintrc config system it was possible to use `eslint-env` configuration comments to define globals for a file.
372
-
These comments are no longer recognized when linting with flat config: in a future version of ESLint, `eslint-env` comments will be reported as errors.
372
+
These comments are no longer recognized when linting with flat config and will be reported as errors.
373
373
For this reason, when migrating from eslintrc to flat config, `eslint-env` configuration comments should be removed from all files.
374
374
They can be either replaced with equivalent but more verbose `global` configuration comments, or dropped in favor of `globals` definitions in the config file.
## <aname="eslint-env-comments"></a> `eslint-env` comments are reported as errors
120
+
121
+
In the now obsolete ESLint v8 configuration system, `/* eslint-env */` comments could be used to define globals for a file. The current configuration system does not support such comments, and starting with ESLint v10, they are reported as errors during linting.
122
+
123
+
```text
124
+
error: /* eslint-env */ comments are no longer supported at file.js:1:1:
125
+
> 1 | /* eslint-env node -- Used in Node.js */
126
+
| ^
127
+
```
128
+
129
+
**To address:** Remove any `eslint-env` comments from your code. If you are still using the old configuration system and need help migrating, check the [migration guide](./configure/migration-guide#eslint-env-configuration-comments).
"\x1B[0m \x1B[2m51:1\x1B[22m \x1B[31merror\x1B[39m Duplicate /* eslint no-restricted-syntax */ configuration comment. Each example should contain only one. Split this example into multiple examples\x1B[0m\n"+
`\x1B[0m \x1B[2m64:1\x1B[22m \x1B[31merror\x1B[39m "ecmaVersion" must be one of ${[3,5, ...Array.from({length: LATEST_ECMA_VERSION-2015+1},(_,index)=>index+2015)].join(", ")}\x1B[0m\n`+
92
-
"\x1B[0m \x1B[2m76:1\x1B[22m \x1B[31merror\x1B[39m /* eslint-env */ comments are no longer supported. Remove the comment\x1B[0m\n"+
93
-
"\x1B[0m \x1B[2m78:1\x1B[22m \x1B[31merror\x1B[39m /* eslint-env */ comments are no longer supported. Remove the comment\x1B[0m\n"+
94
-
"\x1B[0m \x1B[2m79:1\x1B[22m \x1B[31merror\x1B[39m /* eslint-env */ comments are no longer supported. Remove the comment\x1B[0m\n"+
92
+
"\x1B[0m \x1B[2m76:1\x1B[22m \x1B[31merror\x1B[39m Unexpected lint error found: /* eslint-env */ comments are no longer supported\x1B[0m\n"+
93
+
"\x1B[0m \x1B[2m78:1\x1B[22m \x1B[31merror\x1B[39m Unexpected lint error found: /* eslint-env */ comments are no longer supported\x1B[0m\n"+
94
+
"\x1B[0m \x1B[2m79:1\x1B[22m \x1B[31merror\x1B[39m Unexpected lint error found: /* eslint-env */ comments are no longer supported\x1B[0m\n"+
"\x1B[0m \x1B[2m97:7\x1B[22m \x1B[31merror\x1B[39m Unexpected lint error found: Using 'ArrayPattern' is not allowed \x1B[2mno-restricted-syntax\x1B[22m\x1B[0m\n"+
97
97
"\x1B[0m \x1B[2m105:1\x1B[22m \x1B[31merror\x1B[39m Incorrect examples should have at least one error reported by the rule\x1B[0m\n"+
0 commit comments