-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed as not planned
Closed as not planned
Copy link
Labels
coreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLint
Description
ESLint version
v9.26.0
What problem do you want to solve?
eslint-config-prettier
is commonjs only + exports.rules
/exports.name
, so import * as eslintConfigPrettier from 'eslint-config-prettier'
should be used when using eslint.config.mjs
, but node will add an extra default
property on eslintConfigPrettier
in this case.
import * as eslintConfigPrettier from 'eslint-config-prettier'
console.log(Object.keys(eslintConfigPrettier)) // [ 'default', 'rules' ]
import * as eslintConfigPrettierFlat from 'eslint-config-prettier/flat'
console.log(Object.keys(eslintConfigPrettierFlat)) // [ 'default', 'name', 'rules' ]
But those can not be used directly as ESLint flat config due to the default
property:
Oops! Something went wrong! :(
ESLint: 9.26.0
ConfigError: Config (unnamed): Unexpected key "default" found.
What do you think is the correct solution?
- Ignore
default
key - Ignore all unknown keys, I don't get why we're vailidating the unknown keys actually, for example, we had to add an extra
/flat
entry only for adding a newname
property forflat
config which is unavailable ineslintrc
, this is a bit ridiculous to myself: fix: separate the/flat
entry for compatibility prettier/eslint-config-prettier#309
Participation
- I am willing to submit a pull request for this change.
Additional comments
No response
Metadata
Metadata
Assignees
Labels
coreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLint
Type
Projects
Status
Complete