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
Copy file name to clipboardExpand all lines: docs/src/integrate/nodejs-api.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -552,7 +552,7 @@ The `LoadedFormatter` value is the object to convert the [LintResult] objects to
552
552
553
553
## loadESLint()
554
554
555
-
The `loadESLint()` function is used for integrations that wish to support both the current configuration system (flat config) and the old configuration system (eslintrc). This function returns the correct `ESLint` class implementation based on the arguments provided:
555
+
The `loadESLint()` function is used for integrations that wish to support different ESLint versions. This function returns the correct `ESLint` class implementation based on the arguments provided:
Copy file name to clipboardExpand all lines: docs/src/use/command-line-interface.md
+9-113Lines changed: 9 additions & 113 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Please note that when passing a glob as a parameter, it is expanded by your shel
46
46
args: ["\"lib/**\""]
47
47
}) }}
48
48
49
-
If you are using a [flat configuration file](./configure/configuration-files) (`eslint.config.js`), you can also omit the file arguments and ESLint will use `.`. For instance, these two lines perform the same operation:
49
+
You can also omit the file arguments and ESLint will use `.`. For instance, these two lines perform the same operation:
50
50
51
51
{{ npx_tabs ({
52
52
package: "eslint",
@@ -58,8 +58,6 @@ If you are using a [flat configuration file](./configure/configuration-files) (`
58
58
args: []
59
59
}) }}
60
60
61
-
If you are not using a flat configuration file, running ESLint without file arguments results in an error.
62
-
63
61
**Note:** You can also use alternative package managers such as [Yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/) to run ESLint. For pnpm use `pnpm dlx eslint` and for Yarn use `yarn dlx eslint`.
64
62
65
63
## Pass Multiple Values to an Option
@@ -162,7 +160,7 @@ Miscellaneous:
162
160
163
161
#### `--no-config-lookup`
164
162
165
-
**Flat Config Mode Only.**Disables use of configuration from files.
163
+
Disables use of configuration from files.
166
164
167
165
-**Argument Type**: No argument.
168
166
@@ -173,19 +171,6 @@ Miscellaneous:
173
171
args: ["--no-config-lookup", "file.js"]
174
172
}) }}
175
173
176
-
#### `--no-eslintrc`
177
-
178
-
**eslintrc Mode Only.** Disables use of configuration from `.eslintrc.*` and `package.json` files. For flat config mode, use [`--no-config-lookup`](#--no-config-lookup) instead.
179
-
180
-
-**Argument Type**: No argument.
181
-
182
-
##### `--no-eslintrc` example
183
-
184
-
{{ npx_tabs ({
185
-
package: "eslint",
186
-
args: ["--no-eslintrc", "file.js"]
187
-
}) }}
188
-
189
174
#### `-c`, `--config`
190
175
191
176
This option allows you to specify an additional configuration file for ESLint (see [Configure ESLint](configure/) for more).
@@ -204,7 +189,7 @@ This example uses the configuration file at `~/my.eslint.config.js`, which is us
204
189
205
190
#### `--inspect-config`
206
191
207
-
**Flat Config Mode Only.**This option runs `npx @eslint/config-inspector@latest` to start the [config inspector](https://github.com/eslint/config-inspector). You can use the config inspector to better understand what your configuration is doing and which files it applies to. When you use this flag, the CLI does not perform linting.
192
+
This option runs `npx @eslint/config-inspector@latest` to start the [config inspector](https://github.com/eslint/config-inspector). You can use the config inspector to better understand what your configuration is doing and which files it applies to. When you use this flag, the CLI does not perform linting.
208
193
209
194
-**Argument Type**: No argument.
210
195
@@ -215,27 +200,6 @@ This example uses the configuration file at `~/my.eslint.config.js`, which is us
215
200
args: ["--inspect-config"]
216
201
}) }}
217
202
218
-
#### `--env`
219
-
220
-
**eslintrc Mode Only.** This option enables specific environments.
221
-
222
-
-**Argument Type**: String. One of the available environments.
223
-
-**Multiple Arguments**: Yes
224
-
225
-
Details about the global variables defined by each environment are available in the [Specifying Environments](configure/language-options-deprecated#specifying-environments) documentation. This option only enables environments. It does not disable environments set in other configuration files. To specify multiple environments, separate them using commas, or use the option multiple times.
This option allows you to specify additional file extensions to lint.
@@ -324,28 +288,6 @@ This option allows you to specify parser options to be used by ESLint. The avail
324
288
previousCommands: ["echo \'3 ** 4\'"]
325
289
}) }}
326
290
327
-
#### `--resolve-plugins-relative-to`
328
-
329
-
**eslintrc Mode Only.** Changes the directory where plugins are resolved from.
330
-
331
-
-**Argument Type**: String. Path to directory.
332
-
-**Multiple Arguments**: No
333
-
-**Default Value**: By default, plugins are resolved from the directory in which your configuration file is found.
334
-
335
-
This option should be used when plugins were installed by someone other than the end user. It should be set to the project directory of the project that has a dependency on the necessary plugins.
336
-
337
-
For example:
338
-
339
-
- When using a config file that is located outside of the current project (with the `--config` flag), if the config uses plugins which are installed locally to itself, `--resolve-plugins-relative-to` should be set to the directory containing the config file.
340
-
- If an integration has dependencies on ESLint and a set of plugins, and the tool invokes ESLint on behalf of the user with a preset configuration, the tool should set `--resolve-plugins-relative-to` to the top-level directory of the tool.
@@ -406,29 +348,6 @@ To ignore rules in configuration files and only run rules specified in the comma
406
348
comment: "Only apply rule from the command line"
407
349
}) }}
408
350
409
-
#### `--rulesdir`
410
-
411
-
**Deprecated**: Use [rules from custom plugins](https://eslint.org/blog/2022/08/new-config-system-part-2/#from---rulesdir-to-runtime-plugins) instead.
412
-
413
-
**eslintrc Mode Only.** This option allows you to specify another directory from which to load rules files. This allows you to dynamically load new rules at run time. This is useful when you have custom rules that aren't suitable for being bundled with ESLint.
414
-
415
-
-**Argument Type**: String. Path to directory. The rules in your custom rules directory must follow the same format as bundled rules to work properly.
416
-
-**Multiple Arguments**: Yes
417
-
418
-
Note that, as with core rules and plugin rules, you still need to enable the rules in configuration or via the `--rule` CLI option in order to actually run those rules during linting. Specifying a rules directory with `--rulesdir` does not automatically enable the rules within that directory.
@@ -501,31 +420,9 @@ This option is helpful if you are using another program to format your code, but
501
420
502
421
### Ignore Files
503
422
504
-
#### `--ignore-path`
505
-
506
-
**eslintrc Mode Only.** This option allows you to specify the file to use as your `.eslintignore`.
507
-
508
-
-**Argument Type**: String. Path to file.
509
-
-**Multiple Arguments**: No
510
-
-**Default Value**: By default, ESLint looks for `.eslintignore` in the current working directory.
511
-
512
-
**Note:**`--ignore-path` is only supported when using [deprecated configuration](./configure/configuration-files-deprecated). If you want to include patterns from a `.gitignore` file in your `eslint.config.js` file, please see [including `.gitignore` files](./configure/ignore#including-gitignore-files).
Disables excluding of files from [`--ignore-pattern`](#--ignore-pattern) flags and the `ignores` property in configuration. In eslintrc mode, `.eslintignore` files, [`--ignore-path`](#--ignore-path) flags, and the `ignorePatterns` property in configuration are also disabled.
425
+
Disables excluding of files from [`--ignore-pattern`](#--ignore-pattern) flags and the `ignores` property in configuration.
529
426
530
427
-**Argument Type**: No argument.
531
428
@@ -538,9 +435,9 @@ Disables excluding of files from [`--ignore-pattern`](#--ignore-pattern) flags a
538
435
539
436
#### `--ignore-pattern`
540
437
541
-
This option allows you to specify patterns of files to ignore. In eslintrc mode, these are in addition to `.eslintignore`.
438
+
This option allows you to specify patterns of files to ignore.
542
439
543
-
-**Argument Type**: String. The supported syntax is the same as for [`ignores` patterns](configure/configuration-files#excluding-files-with-ignores), which use [minimatch](https://www.npmjs.com/package/minimatch) syntax. In eslintrc mode, the syntax is the same as for [`.eslintignore` files](configure/ignore-deprecated#the-eslintignore-file), which use the same patterns as the [`.gitignore` specification](https://git-scm.com/docs/gitignore). You should quote your patterns in order to avoid shell interpretation of glob patterns.
440
+
-**Argument Type**: String. The supported syntax is the same as for [`ignores` patterns](configure/configuration-files#excluding-files-with-ignores), which use [minimatch](https://www.npmjs.com/package/minimatch) syntax. You should quote your patterns in order to avoid shell interpretation of glob patterns.
544
441
-**Multiple Arguments**: Yes
545
442
546
443
##### `--ignore-pattern` example
@@ -727,7 +624,6 @@ This allows you to set an ESLint config without files modifying it. All inline c
727
624
-`/*eslint-enable*/`
728
625
-`/*global*/`
729
626
-`/*eslint*/`
730
-
-`/*eslint-env*/`
731
627
-`// eslint-disable-line`
732
628
-`// eslint-disable-next-line`
733
629
@@ -963,7 +859,7 @@ The ESLint team may ask for this information to help solve bugs. When you use th
963
859
964
860
#### `--no-error-on-unmatched-pattern`
965
861
966
-
This option prevents errors when a quoted glob pattern or `--ext`is unmatched. This does not prevent errors when your shell can't match a glob.
862
+
This option prevents errors when a quoted glob pattern is unmatched. This does not prevent errors when your shell can't match a glob.
967
863
968
864
-**Argument Type**: No argument.
969
865
@@ -989,7 +885,7 @@ This option causes ESLint to exit with exit code 2 if one or more fatal parsing
989
885
990
886
#### `--no-warn-ignored`
991
887
992
-
**Flat Config Mode Only.**This option suppresses both `File ignored by default` and `File ignored because of a matching ignore pattern` warnings when an ignored filename is passed explicitly. It is useful when paired with `--max-warnings 0` as it will prevent exit code 1 due to the aforementioned warning.
888
+
This option suppresses both `File ignored by default` and `File ignored because of a matching ignore pattern` warnings when an ignored filename is passed explicitly. It is useful when paired with `--max-warnings 0` as it will prevent exit code 1 due to the aforementioned warning.
993
889
994
890
-**Argument Type**: No argument.
995
891
@@ -1002,7 +898,7 @@ This option causes ESLint to exit with exit code 2 if one or more fatal parsing
1002
898
1003
899
#### `--pass-on-no-patterns`
1004
900
1005
-
This option allows ESLint to exit with code 0 when no file or directory patterns are passed. Without this option, ESLint assumes you want to use `.` as the pattern. (When running in legacy eslintrc mode, ESLint will exit with code 1.)
901
+
This option allows ESLint to exit with code 0 when no file or directory patterns are passed. Without this option, ESLint assumes you want to use `.` as the pattern.
Copy file name to clipboardExpand all lines: docs/src/use/configure/configuration-files-deprecated.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ The second way to use configuration files is to save the file wherever you would
39
39
eslint -c myconfig.json myfiletotest.js
40
40
```
41
41
42
-
If you are using one configuration file and want ESLint to ignore any `.eslintrc.*` files, make sure to use [`--no-eslintrc`](../command-line-interface#--no-eslintrc) along with the [`--config`](../../use/command-line-interface#-c---config) flag.
42
+
If you are using one configuration file and want ESLint to ignore any `.eslintrc.*` files, make sure to use `--no-eslintrc` along with the [`--config`](../../use/command-line-interface#-c---config) flag.
43
43
44
44
Here's an example JSON configuration file that uses the `typescript-eslint` parser to support TypeScript syntax:
45
45
@@ -432,4 +432,4 @@ If `eslint` could find configuration files in the project, `eslint` ignores `~/.
432
432
433
433
`~/.eslintrc.*`files load shareable configs and custom parsers from `~/node_modules/` – similarly to `require()` – in the user's home directory. Please note that it doesn't load global-installed packages.
434
434
435
-
`~/.eslintrc.*`files load plugins from `$CWD/node_modules` by default in order to identify plugins uniquely. If you want to use plugins with `~/.eslintrc.*` files, plugins must be installed locally per project. Alternatively, you can use the [`--resolve-plugins-relative-to` CLI option](../command-line-interface#--resolve-plugins-relative-to) to change the location from which ESLint loads plugins.
435
+
`~/.eslintrc.*`files load plugins from `$CWD/node_modules` by default in order to identify plugins uniquely. If you want to use plugins with `~/.eslintrc.*` files, plugins must be installed locally per project. Alternatively, you can use the `--resolve-plugins-relative-to` CLI option to change the location from which ESLint loads plugins.
## <aname="remove-eslintrc"></a> Old config format no longer supported
75
+
76
+
ESLint v9 introduced a [new default configuration format](./configure/configuration-files) based on the `eslint.config.js` file. The [old format](./configure/configuration-files-deprecated), which used `.eslintrc` or `.eslintrc.json`, could still be enabled in v9 by setting the `ESLINT_USE_FLAT_CONFIG` environment variable to `false`.
77
+
78
+
Starting with ESLint v10, the old configuration format is no longer supported.
79
+
80
+
**To address:**
81
+
82
+
- Follow the instructions in the [configuration migration guide](./configure/migration-guide).
83
+
- Be aware that the deprecated APIs `FlatESLint` and `LegacyESLint` have been removed. Always use `ESLint` instead.
84
+
- The `configType` option of the `Linter` class can no longer be set to `"eslintrc"`. Remove the option to use the new configuration format.
## <aname="radix"></a> Deprecated options of the `radix` rule
72
89
73
90
As of ESLint v10.0.0, string options `"always"` and `"as-needed"` of the [`radix`](../rules/radix) rule are deprecated. Setting either of these options doesn't change the behavior of this rule, which now always enforces providing a radix, as it was the case when the `"always"` option (default) was specified. Since the default radix depends on the first argument of `parseInt()`, this rule assumes that the second argument (the radix) is always needed.
Copy file name to clipboardExpand all lines: docs/src/use/migrating-to-6.0.0.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
@@ -98,7 +98,7 @@ As a rule of thumb: With ESLint v6, plugins should always be installed locally,
98
98
99
99
**To address:** If you use a global installation of ESLint (e.g. installed with `npm install eslint --global`) along with plugins, you should install those plugins locally in the projects where you run ESLint. If your config file extends shareable configs and/or parsers, you should ensure that those packages are installed as dependencies of the project containing the config file.
100
100
101
-
If you use a config file located outside of a local project (with the `--config` flag), consider installing the plugins as dependencies of that config file, and setting the [`--resolve-plugins-relative-to`](./command-line-interface#--resolve-plugins-relative-to) flag to the location of the config file.
101
+
If you use a config file located outside of a local project (with the `--config` flag), consider installing the plugins as dependencies of that config file, and setting the `--resolve-plugins-relative-to` flag to the location of the config file.
0 commit comments