Open fregante opened 3 years ago
XO currently just uses the rule’s default, but a change to it was rejected because it would be breaking.
Example config:
'no-mixed-operators': [
'error',
{
// Customize the defaults to force being explicit about use of null-coalescing operator because its precedence
// is unintuitive. See: https://eslint.org/docs/rules/no-mixed-operators
groups: [
// Conflicts with Prettier: https://github.com/prettier/prettier/issues/3968
// ["+", "-", "*", "/", "%", "**", "??"],
['&', '|', '^', '~', '<<', '>>', '>>>', '??'],
['==', '!=', '===', '!==', '>', '>=', '<', '<=', '??'],
['&&', '||', '??'],
['in', 'instanceof', '??'],
],
},
],
👍 Pull request welcome.
// Conflicts with Prettier: https://github.com/prettier/prettier/issues/3968
That's not a concern here.
Originally posted in https://github.com/eslint/eslint/issues/14975
What rule do you want to change?
no-mixed-operators
:https://github.com/eslint/eslint/blob/c981fb1994cd04914042ced1980aa86b68ba7be9/lib/rules/no-mixed-operators.js#L25-L40
Please provide some example code that this change will affect:
What will the rule do after it's changed?
Suggest a fix: