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
{{ message }}
Repository navigation
@stylistic/no-mixed-operators isn't compatible with Prettier #889
✖ 4:34 Unexpected mix of * and +. Use parentheses to clarify the intended order of operations. @stylistic/no-mixed-operators
✖ 4:65 Unexpected mix of * and +. Use parentheses to clarify the intended order of operations. @stylistic/no-mixed-operators
@patrik-csak's diagnosis is right — the re-enable is in eslint-config-xo. In index.js, prettierCompatibleSpecialRules re-adds @stylistic/no-mixed-operatorsafter spreading eslintConfigPrettier.rules (which already sets it to 0), so it's back on in both prettier: true and prettier: 'compat'.
It is genuinely an eslint-config-prettier "special rule", but unlike the others in that list it can't be satisfied next to Prettier: Prettier strips the clarifying parentheses the rule asks for (their docs suggest extracting an intermediate variable instead). So the fix is just to drop that one entry from prettierCompatibleSpecialRules and let eslint-config-prettier's 0 stand — non-Prettier XO still enforces the rule via the base config.
I've written this up with regression tests for all three cases (off in compat, off in true, still enforced by default) and verified it locally — happy to share the patch if it'd save someone time.
Heads-up for whoever picks it up: xo's test/xo-to-eslint.test.ts asserts this rule is present in the Prettier output, so those two assertions would need to expect the disabled value on the next eslint-config-xo bump.
Activity
ctranstrum commentedon Jun 20, 2026
I ran into the same issue with
*and**with prettier as well. Trying to switch toMath.pow()instead of**only triggered a different rule.patrik-csak commentedon Jul 5, 2026
eslint-config-prettierdoes include and disable the rule:https://github.com/prettier/eslint-config-prettier/blob/v10.1.8/index.js#L17
eslint-config-xoenables it:https://github.com/xojs/eslint-config-xo/blob/v0.56.0/index.js#L162-L173
snowyukitty commentedon Jul 15, 2026
@patrik-csak's diagnosis is right — the re-enable is in
eslint-config-xo. Inindex.js,prettierCompatibleSpecialRulesre-adds@stylistic/no-mixed-operatorsafter spreadingeslintConfigPrettier.rules(which already sets it to0), so it's back on in bothprettier: trueandprettier: 'compat'.It is genuinely an
eslint-config-prettier"special rule", but unlike the others in that list it can't be satisfied next to Prettier: Prettier strips the clarifying parentheses the rule asks for (their docs suggest extracting an intermediate variable instead). So the fix is just to drop that one entry fromprettierCompatibleSpecialRulesand leteslint-config-prettier's0stand — non-Prettier XO still enforces the rule via the base config.I've written this up with regression tests for all three cases (off in
compat, off intrue, still enforced by default) and verified it locally — happy to share the patch if it'd save someone time.Heads-up for whoever picks it up:
xo'stest/xo-to-eslint.test.tsasserts this rule is present in the Prettier output, so those two assertions would need to expect the disabled value on the nexteslint-config-xobump.Happy to help more here if it's useful.
Manual lint fixes
chore(deps-dev): bump xo from 0.60.0 to 4.0.0 (#54)