You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using "type": "module" in my package.json and have an eslint.config.cjs instead of eslint.config.js file at the root of my project.
When I try to create a library with the @nx/angular:library generator, the generator correctly finds the config file, but generates only a barebones eslint.config.js file in the new library:
Expected Behavior
The generator should generate an eslint.config.cjs file and use the longer base config that it would generate with an eslint.config.js file at project root.
GitHub Repo
No response
Steps to Reproduce
Generate a new NX Angular workspace
Change the name of eslint.config.js to eslint.config.cjs
I have looked into the code a bit and believe this may be an issue with the addLintingGenerator, as it will always generate an eslint.config.js file. There also is already a constant eslintFlatConfigFilenames, but it is not used when checking if the additional code should be added to the newly generated config file.
I would also be happy to try to make a PR for this.
The text was updated successfully, but these errors were encountered:
LWC241
changed the title
Angular Library generator creates wrong eslint config with eslint.config.cjs
Angular Library generator creates wrong eslint config with eslint.config.cjs at project root
Oct 1, 2024
…ors #28214 (#28672)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->
<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->
<!-- 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 -->
When the workspace has `eslint.config.cjs` at the root, generation of
new lint projects currently does not check for it correctly
## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure utils continue to work as expected when `eslint.config.cjs` is
detected at the workspaceRoot
## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->
Fixes#28214
Current Behavior
I am using
"type": "module"
in my package.json and have aneslint.config.cjs
instead ofeslint.config.js
file at the root of my project.When I try to create a library with the
@nx/angular:library
generator, the generator correctly finds the config file, but generates only a bareboneseslint.config.js
file in the new library:Expected Behavior
The generator should generate an
eslint.config.cjs
file and use the longer base config that it would generate with aneslint.config.js
file at project root.GitHub Repo
No response
Steps to Reproduce
eslint.config.js
toeslint.config.cjs
@nx/angular:library
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
I have looked into the code a bit and believe this may be an issue with the
addLintingGenerator
, as it will always generate aneslint.config.js
file. There also is already a constanteslintFlatConfigFilenames
, but it is not used when checking if the additional code should be added to the newly generated config file.I would also be happy to try to make a PR for this.
The text was updated successfully, but these errors were encountered: