Support eslint.config.cjs
See original GitHub issueThe problem you want to solve.
The upcoming simplified configuration system (RFC), or flat config (#13481), only supports eslint.config.js
, but it can’t be used if there’s "type": "module"
in the project’s package.json
, since ESLint doesn’t currently support loading an ECMAScript module as a config file.
Your take on the correct solution to problem.
ESLint should also support eslint.config.cjs
by default, so that "type": "module"
can be used along with ESLint.
Are you willing to submit a pull request to implement this change?
Maybe if it’s not too hard to implement.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Configuration Files - ESLint - Pluggable JavaScript Linter
ESLint supports adding shared settings into configuration files. Plugins use settings to specify the information that should be shared across all of its...
Read more >ESLint's new config system, Part 2: Introduction to flat config
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Configuring ESLint - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Configuration Files (New) - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Language Options - ESLint - Pluggable JavaScript Linter
ESLint allows you to specify the JavaScript language options you want to support. By default, ESLint expects ECMAScript 5 syntax. You can override...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’re thinking about using
import()
to loadeslint.config.js
. In that case, I think that support for.cjs
and.mjs
extensions doesn’t seem necessary: in"type": "module"
projectseslint.config.js
should be written as ESM, in other projects as CJS.If it turns out that we still have to use
require()
to load configs, then I think we should supporteslint.config.cjs
, becauserequire("eslint.config.js")
doesn’t work in"type": "module"
projects.you can use
.eslintrc.cjs
.