Axetroy

Results 198 comments of Axetroy

> [#2425 (comment)](https://github.com/sindresorhus/eslint-plugin-unicorn/pull/2425#discussion_r1721190952) I do remember I updated it 😢

Perhaps, it should be renamed to `consistent-existence-index-check`? since this rule check for `indexOf()`, `lastIndexOf()`, `findIndex()`, and `findLastIndex()`

> @axetroy I simplified the rule only check `index < 0`, `index >= 0`, `index > -1`. I think it's enough, what do you think? I think we should support...

> > Perhaps, it should be renamed to consistent-existence-index-check? > > 👍 @sindresorhus Renamed

CI fail on linting current codebase, Should I fix them in this PR, or in another separate? ``` /home/runner/work/eslint-plugin-unicorn/eslint-plugin-unicorn/rules/prefer-string-slice.js Error: 108:4 error Prefer `Array#toReversed()` over `Array#reverse()` unicorn/prefer-change-array-by-copy /home/runner/work/eslint-plugin-unicorn/eslint-plugin-unicorn/rules/prevent-abbreviations.js Error: 97:38...

Block, Since node 18.x is not support `Change Array By Copy` APIs. But this version still needs to be tested in CI. `npm run run-rules-on-codebase` is always fail.

> Node 18 EOL is on 30 Apr 2025, does this PR have to wait 8 months? I think it's easier to disable this specific rule in `eslint.dogfooding.config.mjs` It sounds...

I prefer not to auto-repair at all. After all, code like this (`[...someOtherArray].reverse()`) is rare. However, due to compatibility issues, should we set this rule as `recommended: false`?

Maybe it needs a better rule name There are several common objects in JavaScript that also have get/has methods. `{Map,WeakMap,FormData,URLSearchParams.Headers}#{get,has}`. In addition, there are many packages in the community that...

> it's common to store falsely values in a Map, especially 0/false, and I don't think we have a good way to make sure it's just checking existence. Agreed