Skip to content

Commit

Permalink
chore: reorganize intentionally unused rule list
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyiam committed Oct 5, 2024
1 parent bb2f23f commit ae55095
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions src/_intentionally-unused-rules.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
export const intentionallyUnusedRules: string[] = [
// From rule documentation:
// > If possible, it is recommended to use tsconfig's noImplicitReturns option rather than this rule. noImplicitReturns is powered by TS's type information and control-flow analysis so it has better coverage than this rule.
'@typescript-eslint/consistent-return',
'consistent-return',
// ## Incompatible with JS

// From trule documentation:
// From rule documentation:
// > If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files.
'@typescript-eslint/explicit-member-accessibility',

// ## "too much"

'@typescript-eslint/default-param-last',
'default-param-last',

// style
'@typescript-eslint/member-ordering',

// Made redundant by TS strict mode and `@typescript-eslint/explicit-function-return-type`
'@typescript-eslint/no-shadow',
'no-shadow',

// ## redundant

// TS strict mode and `@typescript-eslint/explicit-function-return-type`
'@typescript-eslint/explicit-module-boundary-types',

// Made redundant by no-new-native-nonconstructor
// no-new-native-nonconstructor
'no-new-symbol',

// From rule documentation:
// > If possible, it is recommended to use tsconfig's noImplicitReturns option rather than this rule. noImplicitReturns is powered by TS's type information and control-flow analysis so it has better coverage than this rule.
'@typescript-eslint/consistent-return',
'consistent-return',

// From rule documentation:
// > Requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability. TypeScript is often better at inferring types than easily written type annotations would allow.
// >
Expand All @@ -29,14 +37,15 @@ export const intentionallyUnusedRules: string[] = [
// Covered by strict TypeScript
'@typescript-eslint/no-invalid-this',

// For project specific usage
// ## Project specific

'@typescript-eslint/no-restricted-imports',

'@typescript-eslint/no-restricted-types',

'n/no-restricted-import',

'n/no-restricted-require',
'no-restricted-imports',

// Too strict
'@typescript-eslint/no-shadow',
'no-shadow',
'no-restricted-imports',
]

0 comments on commit ae55095

Please sign in to comment.