-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
We could also consider implementing a check in
@eslint/create-config
during init to verify whether the Node version supports this feature, then determine the output extension accordingly.
Originally posted by @kecrily in #20129
On some Node.js versions1, syntax-detection feature can determine if a file is an ES Module (ESM). This means it's not necessary to use an .mjs
extension for an ESM-style eslint.config.*
file, even in a CJS environment (i.e., a project with no "type"
field in package.json
).
If the feature is supported but "type"
is set to "commonjs"
, should we still create an ESM-style eslint.config.js
?
Footnotes
-
v22.7.0 and v20.19.0 enabled by default ↩
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Needs Triage