fisker Cheung
fisker Cheung
I'm really sorry. Super busy recently, I'll review ASAP.
Can you fix the failing tests?
Let's focus on `Set`?
And let's try to statically analyze the AST too, not only literals. ## Fail ```js new Set([-1, -1]); ``` ```js const foo = 2; new Set([foo, 2]); ``` ```js new...
I remember we have a rule proposal to prevent unnecessary negated condition, but I forget what's in that proposal and I can't find it.
Not this one, I'll search issues again.
This #856. Kind of related, but this is more complicated.
Adding this rule will also benefit `prefer-switch` rule, currently we inserted `{}` for almost all cases. https://github.com/sindresorhus/eslint-plugin-unicorn/blob/ab78c0ddac401abbe122373de0a7c1ebb990b144/rules/prefer-switch.js#L123
Let's implement this rule with `always` and `avoid` option?
I guess we can add an option for this.