prefer-ternary: convert options to object, add onlyAssignments option#2856
prefer-ternary: convert options to object, add onlyAssignments option#2856ipanasenko wants to merge 4 commits intosindresorhus:mainfrom
prefer-ternary: convert options to object, add onlyAssignments option#2856Conversation
3b77a6d to
db4e58f
Compare
let foo;
if (foo) {
foo = 1;
} else {
foo = 2;
}to: let foo = foo ? 1 : 2;which throws (
let foo;
// keep me
if (test) { ... }becomes: let foo = test ? ... : ...;with the comment deleted.
|
|
My $0.02: I feel like it makes less sense to limit it to only assignments, and I'd prefer that the rule not warn on let output = await (test ? a() : b()); |
|
@cobaltt7 in this PR it will be fixed like this: let output = test ? await a() : await b(); |
|
Merge conflict. __ Incomplete TDZ check — only inspects
|
814b622 to
0e023e3
Compare
Fixes #1633
Was created with the help from Claude 4.5 Opus