fisker Cheung
fisker Cheung
#2643 Only added test, need time to learn how it works in vue-eslint-parser.
### Description This rule make sense when checking other value types, but doesn't make sense when checking error. ### Examples ```js try { } catch (error) { if (error instanceof...
### Description Make sense to add it, didn't do it in ##2339 since it's diffcult. ### Examples ```js // ❌ ` \\a ` // ✅ String.raw` \a ` ``` ###...
### Description During refactoring, some strings may not need `String.raw` anymore, should use a string literal instead. ### Examples ```js // ❌ String.raw`a` // ✅ 'a' ``` ### Proposed rule...
### Description The core rule [`logical-assignment-operators`](https://eslint.org/docs/latest/rules/logical-assignment-operators) auto fixes ```js if (!a) { a = 1 } ``` to ```js a ||= 1 ``` But sometimes, `a ??= 1` should be...
### Description I think in all cases use `Number.isInteger`, [`Number.isSafeInteger`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger) should be preferred. ### Examples ```js // ❌ if (!Number.isInteger(x)) {} // ✅ if (!Number.isSafeInteger(x)) {} ``` ### Additional Info...
### Description ESLint marked it as frozen, won't accept changes https://github.com/eslint/eslint/issues/19468, let's implement? ### Examples See https://eslint.org/docs/latest/rules/no-useless-concat ### Proposed rule name unicorn/no-useless-concat ### Additional Info _No response_
### Description Improve readability. ### Examples ```js // ❌ if (a - b > 0); // ✅ if (a > b); ``` ```js // ❌ if (a - b >=...
### Description I found this pattern https://github.com/sindresorhus/eslint-plugin-unicorn/blob/e48a6203736e56cd2ff752613ed7ce8b5d4f008a/rules/no-unnecessary-polyfills.js#L130-L132 in https://github.com/sindresorhus/eslint-plugin-unicorn/pull/2582, which use `Object.entry` to search for a specific key and access the value, which should use a direct object property access...
### Description [Iterator#toArray()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/toArray) is more clear to me that coverts iterator to array than `[...iterator]`, especially when `iterator` is a long expression. ### Examples ```js // ❌ [...map.values()].map(value => value...