-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(eslint): rename eslint.config.js to eslint.config.cjs to resolve them as CommonJS #29334
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
144e881
to
0fa0b93
Compare
0fa0b93
to
224a3ee
Compare
224a3ee
to
29bb7fe
Compare
4506885
to
b6aa8af
Compare
b6aa8af
to
5d373e1
Compare
5d373e1
to
3126725
Compare
3126725
to
053838f
Compare
053838f
to
f27e9c6
Compare
packages/workspace/src/generators/move/lib/update-project-root-files.ts
Outdated
Show resolved
Hide resolved
f27e9c6
to
997feab
Compare
aa38467
to
b682862
Compare
Your CI Pipeline Execution ↗ for commit 7713c79 is in progress ⏳
☁️ Nx Cloud last updated this comment at |
69715a6
to
9e2b5d6
Compare
e1563d3
to
8710fe7
Compare
… them as CommonJS
f5c14e9
to
5606368
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM!
@@ -124,6 +124,10 @@ describe('ast-utils', () => { | |||
] | |||
}).map(config => ({ | |||
...config, | |||
files: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right? This will be setting files to only resolve cts
and mts
? Unless eslint is doing some magical merging behind the scenes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one specifically is when converting eslintrc to flat config when called from convertEslintJsonToFlatConfig
. In those cases the .ts
and .tsx
extensions are already specified. I could add it to the ast utils as well just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it.
5606368
to
7713c79
Compare
… them as CommonJS (#29334) This PR updates our generators to use `eslint.config.cjs` instead of `eslint.config.js` so that Node resolution will treat it as CommonJS. This solves an issue where having `"type": "module"` in `package.json` will result in an error when Node tries to resolve the config file as ESM. Also allows us to clean up out Remix generators to not have to rename to `eslint.config.cjs` to solve the same issue. <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
This PR updates our generators to use
eslint.config.cjs
instead ofeslint.config.js
so that Node resolution will treat it as CommonJS. This solves an issue where having"type": "module"
inpackage.json
will result in an error when Node tries to resolve the config file as ESM.Also allows us to clean up out Remix generators to not have to rename to
eslint.config.cjs
to solve the same issue.Current Behavior
Expected Behavior
Related Issue(s)
Fixes #