-
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(linter): use overrides in root eslint config #3949
Conversation
Nx Cloud ReportCI ran the following commands for commit bea0cfe. Click to see the status, the terminal output, and the build insights.
Sent with 💌 from NxCloud. |
7ac7ec3
to
cfea9ea
Compare
The unit test failure was simply a memory issue on the CircleCI agent... |
* breaking changes - we should also look to replace all the @typescript-eslint | ||
* related plugins and rules below. | ||
*/ | ||
export default { |
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.
Not relevant for this PR but, should the typescript
configuration extend off of this javascript
one?
* feat(linter): use overrides in root eslint config * feat(linter): update-root-eslint-config-to-use-overrides migration
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. |
Current Behavior
The root level ESLint config in an Nx workspace currently applies all configuration (parser, plugins, rules etc) to all files within the workspace.
This is ok for TypeScript and JavaScript (where the same custom parser can be used for both file types), but for Nx to truly support linting any and all frameworks, libraries and tools, it needs to become more precise in how config is applied.
Expected Behavior
We leverage ESLint's "overrides" capability so that we can set up a root config which will support all permutations of Nx workspaces across all frameworks, libraries and tools.
The key point is that we need entirely different ESLint config to apply to different types of files, but we still want to share common config where possible.
I did not need to change any other existing project level configs, they all still work as before.
This is the final step to unlocking proper Angular linting via ESLint in Nx workspaces, because now HTML files (and inline HTML templates within Components) can be linted alongside other source code.
I have personally verified this locally by using a build of this PR and creating a custom Nx workspace which mixes React and Angular apps together.
Related Issue(s)
Fixes #