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
To get started, use the[configuration migrator](https://npmjs.com/package/@eslint/migrate-config) on your existing configuration file (`.eslintrc`,`.eslintrc.json`,`.eslintrc.yml`), like this:
25
25
26
26
{{ npx_tabs({
27
-
package:null,
28
-
args:["@eslint/migrate-config", ".eslintrc.json"]
27
+
package:"@eslint/migrate-config",
28
+
args:[".eslintrc.json"]
29
29
}) }}
30
30
31
31
This will create a starting point for your`eslint.config.js` file but is not guaranteed to work immediately without further modification. It will, however, do most of the conversion work mentioned in this guide automatically.
@@ -44,10 +44,10 @@ To use flat config with ESLint v8, place a `eslint.config.js` file in the root o
44
44
45
45
While the configuration file format has changed from eslintrc to flat config, the following has stayed the same:
46
46
47
-
-Syntax for configuring rules.
48
-
-Syntax for configuring processors.
49
-
-The CLI, except for the flag changes noted in[CLI Flag Changes](#cli-flag-changes).
50
-
-Global variables are configured the same way, but on a different property (see[Configuring Language Options](#configuring-language-options)).
47
+
- Syntax for configuring rules.
48
+
- Syntax for configuring processors.
49
+
- The CLI, except for the flag changes noted in[CLI Flag Changes](#cli-flag-changes).
50
+
- Global variables are configured the same way, but on a different property (see[Configuring Language Options](#configuring-language-options)).
51
51
52
52
##Key Differences between Configuration Formats
53
53
@@ -421,8 +421,8 @@ export default [
421
421
422
422
In eslintrc files, use the`extends` property to use predefined and shareable configs. ESLint comes with two predefined configs that you can access as strings:
423
423
424
-
-`"eslint:recommended"`: the rules recommended by ESLint.
425
-
-`"eslint:all"`: all rules shipped with ESLint.
424
+
-`"eslint:recommended"`: the rules recommended by ESLint.
425
+
-`"eslint:all"`: all rules shipped with ESLint.
426
426
427
427
You can also use the`extends` property to extend a shareable config. Shareable configs can either be paths to local config files or npm package names.
428
428
@@ -625,9 +625,9 @@ export default [
625
625
626
626
The following CLI flags are no longer supported with the flat config file format:
627
627
628
-
-`--rulesdir`
629
-
-`--ext`
630
-
-`--resolve-plugins-relative-to`
628
+
-`--rulesdir`
629
+
-`--ext`
630
+
-`--resolve-plugins-relative-to`
631
631
632
632
The flag`--no-eslintrc` has been replaced with`--no-config-lookup`.
633
633
@@ -691,9 +691,9 @@ With flat config, it's no longer possible to use a `package.json` file to config
691
691
692
692
The following changes have been made from the eslintrc to the flat config file format:
693
693
694
-
-The`root` option no longer exists. (Flat config files act as if`root:true` is set.)
695
-
-The`files` option cannot be a single string anymore, it must be an array.
696
-
-The`sourceType` option now supports the new value`"commonjs"` (`.eslintrc` supports it too, but it was never documented).
694
+
- The`root` option no longer exists. (Flat config files act as if`root:true` is set.)
695
+
- The`files` option cannot be a single string anymore, it must be an array.
696
+
- The`sourceType` option now supports the new value`"commonjs"` (`.eslintrc` supports it too, but it was never documented).
697
697
698
698
## TypeScript Types for Flat Config Files
699
699
@@ -718,6 +718,6 @@ In a future version of the ESLint plugin, you will no longer need to enable this
718
718
719
719
## Further Reading
720
720
721
-
-[Overview of the flat config file format blog post](https://eslint.org/blog/2022/08/new-config-system-part-2/)
722
-
-[API usage of new configuration system blog post](https://eslint.org/blog/2022/08/new-config-system-part-3/)
723
-
-[Background to new configuration system blog post](https://eslint.org/blog/2022/08/new-config-system-part-1/)
721
+
- [Overview of the flat config file format blog post](https://eslint.org/blog/2022/08/new-config-system-part-2/)
722
+
- [API usage of new configuration system blog post](https://eslint.org/blog/2022/08/new-config-system-part-3/)
723
+
- [Background to new configuration system blog post](https://eslint.org/blog/2022/08/new-config-system-part-1/)