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
Override eslint rules in the root eslintrc.json
#5866
Comments
I posted this over on StackOverfow a few days ago. |
I've posted on stack overflow as well https://stackoverflow.com/questions/67797166/esslint-configuration-for-nx-angular-project-no-host-metadata-property |
Thank you for this question @AnkitaSood. This is something we witnessed ourselves at Nrwl while working on projects. Unfortunately, this is not a bug, but rather a feature. Although it might not seem that way. Why this doesn't work on root level? Your lib's Why this works on lib level? By applying your overrides after the Will there be a fix? Unfortunately not, as this would mean we would have to change the default configuration of Solution? As you found out already, a solution would be to apply changes to your project's
Where
Maybe one day there will be a way how to deal with such issues in an elegant way, but currently limitation of Hope this helps, nevertheless. |
If given solution works for you, please also upvote it on stack overflow so that others can easily find it. https://stackoverflow.com/questions/67842095/how-do-i-override-an-eslint-rule-in-my-nx-workspace |
eslintrc.json
@meeroslav thank you for the heads up. However I think there should be then a different way to create angular libs with Nx as most of the time I think the default project eslint configuration would be used and very little time people would want to change it. |
@vincentpalita I understand your position and we have carefully assessed the situation. The reality is that majority of the projects do not consist only of angular apps and libs. More common is to have at least one nest, express or plain typescript library. In those cases having the angular-specific When approaching this situation we usually ask three questions:
If answer to all of these is |
@meeroslav thank you for you reply. This clarify your strategy and I like it that way. |
I would say: Please make a detailed feature request, link this issue and I'll try to work on it as soon as possible. 😃 Also, you are more than welcome to start working on it yourself if your time permits. We love community PRs ❤️ |
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
What is the behavior that currently you experience?
Overriding
@angular-eslint
rules in the baseeslintrc.json
file doesn't work as expected. Overriding rules like@angular-eslint/no-empty-lifecycle-method
,@angular-eslint/no-host-metadata-property
etc. is impossible.Expected Behavior
What is the behavior that you expect to happen?
Rules should be configurable at the base
eslintrc.json
level.Steps to Reproduce
Current
.eslintrc.json
:Adding similar override to a library's
.eslintrc.json
converts the error into a warning. This is what works for a library's.eslintrc.json
Instead of having to add this for each library, the override in the base
.eslintrc.json
should work.Environment
nx report
The text was updated successfully, but these errors were encountered: