Skip to content

Commit

Permalink
Add @typescript-eslint/prefer-find rule
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 6, 2024
1 parent ae44391 commit 0b25758
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ module.exports = {
],

// Disabled for now as it causes too many weird TypeScript issues. I'm not sure whether the problems are caused by bugs in TS or problems in my types.
// TODO: Try to re-enable this again in 2023.
// TODO: Try to re-enable this again in 2026.
// '@typescript-eslint/method-signature-style': 'error',

// We use `@typescript-eslint/naming-convention` in favor of `camelcase`.
Expand Down Expand Up @@ -394,7 +394,7 @@ module.exports = {
}
],

// TODO: Try to enable this again in 2023.
// TODO: Try to enable this again in 2025.
// Disabled for now. This is a great rule. It's just that TypeScript is not good enough yet to not use `any` in many places.
// For example: https://github.com/sindresorhus/refined-github/pull/2391#discussion_r318995182
// '@typescript-eslint/no-explicit-any': [
Expand Down Expand Up @@ -518,7 +518,7 @@ module.exports = {
// `no-unnecessary-condition` is essentially a stricter version of `no-constant-condition`, but that isn't currently enabled
'no-constant-condition': 'error',

// TODO: Try to enable this again in 2023 *if* the following are resolved:
// TODO: Try to enable this again in 2025 *if* the following are resolved:
// - https://github.com/microsoft/TypeScript/issues/36393
// - The rule needs a way to ignore runtime type-checks: https://github.com/sindresorhus/refined-github/pull/3168
// - Run the rule on https://github.com/sindresorhus/refined-github and ensure there are no false-positives
Expand Down Expand Up @@ -582,6 +582,7 @@ module.exports = {
}
],
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/prefer-find': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-includes': 'error',
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
"simple"
],
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"ava": "^2.4.0",
"eslint": "^8.56.0",
"typescript": "^5.3.3"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">=6.19.0",
"@typescript-eslint/parser": ">=6.19.0",
"@typescript-eslint/eslint-plugin": ">=6.21.0",
"@typescript-eslint/parser": ">=6.21.0",
"eslint": ">=8.56.0",
"typescript": ">=5.0.0"
}
Expand Down

0 comments on commit 0b25758

Please sign in to comment.