Disable no-mixed-operators rule
See original GitHub issuePlease consider adding options in the config to disable (or add) certain linting rules. The default options are very aggressive and I end up with a lot of warnings both in command line output and in browser console. My main nemesis is no-mixed-operators
, since I often use the x && y || z
construct as an alternative to ternary operator. It is too common to put disable comments every time.
I can comment out the rules in the plugin, but that doesn’t seem to be a good solution since it won’t work well with updates.
On a side note, what are the implications of ejecting? The manual doesn’t make that very clear. I understand that I can’t go back to “managed” state, but what are the benefits of staying in that state?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
no-mixed-operators - ESLint - Pluggable JavaScript Linter
This rule warns when different operators are used consecutively without parentheses in an expression. var foo = a && b || c ||...
Read more >Mixed operators in JSX - reactjs - Stack Overflow
Disallow mixes of different operators (no-mixed-operators) ... to be notified about mixed operators, then it's safe to disable this rule.
Read more >eslint-plugin-no-mixed-operators - npm
Fixable no-mixed-operators rule for eslint. ... Use it like a regular plugin and disable the original one if it's already enabled.
Read more >fix: Remove superfluous no-mixed-operators rule and re-order
no-mixed-operators is already disabled in eslint-config-prettier: ... This also alphabetizes the remaining rules.
Read more >eslint-config-prettier/README.md - UNPKG
26, - [no-mixed-operators](#no-mixed-operators) ... 191, There a few rules that eslint-config-prettier disables that actually can be.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I compile typescript into the src folder which react-scripts then picks up.
IMO the rules should be setup in such a way as to support generated code.
I think you can disable it adding a
.eslintrc
file in the project root folder and overwritting the create-react-app default rules like this:Hope this helps