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
* Fix: ES module compatibility (fixes#12319)
In ES module packages w/ "type": "module" defined treat all .js files as ES modules. CommonJS files contained in an ES module package should use the .cjs extension.
* Fix Documentation
* Add Tests
* Fix Lint Error
Copy file name to clipboardExpand all lines: docs/user-guide/configuring.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -664,6 +664,7 @@ In each case, the settings in the configuration file override default settings.
664
664
ESLint supports configuration files in several formats:
665
665
666
666
* **JavaScript** - use `.eslintrc.js` and export an object containing your configuration.
667
+
* **JavaScript (ESM)** - use `.eslintrc.cjs` when running ESLint in JavaScript packages that specify `"type":"module"` in their `package.json`. Note that ESLint does not support ESM configuration at this time.
667
668
* **YAML** - use `.eslintrc.yaml` or `.eslintrc.yml` to define the configuration structure.
668
669
* **JSON** - use `.eslintrc.json` to define the configuration structure. ESLint's JSON files also allow JavaScript-style comments.
669
670
* **Deprecated** - use `.eslintrc`, which can be either JSON or YAML.
@@ -672,13 +673,13 @@ ESLint supports configuration files in several formats:
672
673
If there are multiple configuration files in the same directory, ESLint will only use one. The priority order is:
673
674
674
675
1. `.eslintrc.js`
676
+
1. `.eslintrc.cjs`
675
677
1. `.eslintrc.yaml`
676
678
1. `.eslintrc.yml`
677
679
1. `.eslintrc.json`
678
680
1. `.eslintrc`
679
681
1. `package.json`
680
682
681
-
682
683
## Configuration Cascading and Hierarchy
683
684
684
685
When using `.eslintrc.*` and `package.json` files for configuration, you can take advantage of configuration cascading. For instance, suppose you have the following structure:
0 commit comments