What version of Oxlint are you using?
1.67.0
What command did you run?
yarn oxlint -c oxlint.config.mjs
What does your .oxlintrc.json (or oxlint.config.ts) config file look like?
import { defineConfig } from 'oxlint';
export default defineConfig({
categories: {
correctness: 'off',
},
rules: {
'eslint/no-cond-assign': ['error', 'always'],
},
});
What happened?
The rule flags assignment expressions in ternary branches as conditions, but they should not be.
To reproduce:
// assignment: not used as a condition, so it is not flagged
const b = (a += 3);
// ternary: also not used as a condition, but still flagged
a = a ? (a += 5) : 1;
Output:
× eslint(no-cond-assign): Expected a conditional expression and instead saw an assignment
╭─[test.ts:5:12]
4 │ // ternary: also not used as a condition, but still flagged
5 │ a = a ? (a += 5) : 1;
· ──
╰────
help: Consider wrapping the assignment in additional parentheses
Found 0 warnings and 1 error.
Finished in 86ms on 1 file with 1 rules using 16 threads.
What version of Oxlint are you using?
1.67.0
What command did you run?
yarn oxlint -c oxlint.config.mjsWhat does your
.oxlintrc.json(oroxlint.config.ts) config file look like?What happened?
The rule flags assignment expressions in ternary branches as conditions, but they should not be.
To reproduce:
Output: