-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eslint does not support common/module suffixes for Flat Config #22576
Comments
yea this is preventing me from my eslint 9 migration :/ |
Hi 👋 Can the team please offer some sort of expected timetable for this to be resolved? Flat config is the default in ESLint 9, which has been out for over a month now. Flat config itself has been available since 2022. For something very basic like this, we really would appreciate a bit more transparency about any scheduled fix. Thanks! |
The solution for this issue might be here - there is already a TODO:
|
Is there any plan to support flat config by default while creating new workspaces? |
hi @benpsnyder |
Adding support for .cjs was easy but I don't plan to work on .mjs at this time which will be harder to implement. I just solved the quick and easy task for now. |
Can you explain what is hard about it |
I just stumbled upon this as well, got a bit surprised when |
When is this going to be fixed? Do you have a timeline? I am not able to use eslint.config.mjs |
For anyone who wants to use In my case, since we just use the simplest Incidentally I do also have |
@JamesHenry Would this be just adding the file name to https://github.com/nrwl/nx/blob/master/packages/eslint/src/utils/flat-config.ts#L5 here is there more? Willing to contribute if it is easy. |
typescript-eslint seems to have a workaround for now: https://github.com/typescript-eslint/typescript-eslint/blob/v8.18.1/eslint.config.js |
It's not just adding to the array, since our AST utils will fail to update ESM right now, and you will run into errors. We are adding support this month. |
This should be supported now: #29613 |
What version will this land in? |
is it 20.3.2? |
Apparently in 20.4.0: https://github.com/nrwl/nx/releases/tag/20.4.0 |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
Eslint's new Flat Config supports 3 names:
eslint.config.js
(inherits type from package.json, implied to be ESM otherwise)eslint.config.cjs
(explicitly commonjs)eslint.config.mjs
(explicitly ESM)Supported suffixes comes from Eslint's documentation directly: This is quoted from Eslint's documentation itself: https://eslint.org/docs/latest/use/configure/configuration-files-new#configuration-file
However Nx's eslint does not recognize anything other than
eslint.config.js
.This means it is not possible to explictly use CommonJS or ESM, especially if the desired format differs from what is in
package.json
Expected Behavior
Nx's eslint respects all 3 file extensions for Flat Config
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
pnpm 8.15.4
Operating System
Additional Information
Eslint executor versin:
"@nx/eslint": "18.1.3"
This issue is admittedly light on reproducability, because I can just point directly in the code where these issues are occuring.
The following places explicitly hard code the
eslint.config.js
filename, and do not account for other extensions:The text was updated successfully, but these errors were encountered: