Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint-plugin): add *-type-checked-only configs (#8367)
- Loading branch information
1 parent
813ad93
commit 13429cc
Showing
8 changed files
with
302 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/eslint-plugin/src/configs/recommended-type-checked-only.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// THIS CODE WAS AUTOMATICALLY GENERATED | ||
// DO NOT EDIT THIS CODE BY HAND | ||
// SEE https://typescript-eslint.io/users/configs | ||
// | ||
// For developers working in the typescript-eslint monorepo: | ||
// You can regenerate it using `yarn generate:configs` | ||
|
||
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; | ||
|
||
export = { | ||
extends: ['./configs/base', './configs/eslint-recommended'], | ||
rules: { | ||
'@typescript-eslint/await-thenable': 'error', | ||
'@typescript-eslint/no-base-to-string': 'error', | ||
'@typescript-eslint/no-duplicate-type-constituents': 'error', | ||
'@typescript-eslint/no-floating-promises': 'error', | ||
'@typescript-eslint/no-for-in-array': 'error', | ||
'no-implied-eval': 'off', | ||
'@typescript-eslint/no-implied-eval': 'error', | ||
'@typescript-eslint/no-misused-promises': 'error', | ||
'@typescript-eslint/no-redundant-type-constituents': 'error', | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'error', | ||
'@typescript-eslint/no-unsafe-argument': 'error', | ||
'@typescript-eslint/no-unsafe-assignment': 'error', | ||
'@typescript-eslint/no-unsafe-call': 'error', | ||
'@typescript-eslint/no-unsafe-enum-comparison': 'error', | ||
'@typescript-eslint/no-unsafe-member-access': 'error', | ||
'@typescript-eslint/no-unsafe-return': 'error', | ||
'require-await': 'off', | ||
'@typescript-eslint/require-await': 'error', | ||
'@typescript-eslint/restrict-plus-operands': 'error', | ||
'@typescript-eslint/restrict-template-expressions': 'error', | ||
'@typescript-eslint/unbound-method': 'error', | ||
}, | ||
} satisfies ClassicConfig.Config; |
50 changes: 50 additions & 0 deletions
50
packages/eslint-plugin/src/configs/strict-type-checked-only.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// THIS CODE WAS AUTOMATICALLY GENERATED | ||
// DO NOT EDIT THIS CODE BY HAND | ||
// SEE https://typescript-eslint.io/users/configs | ||
// | ||
// For developers working in the typescript-eslint monorepo: | ||
// You can regenerate it using `yarn generate:configs` | ||
|
||
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; | ||
|
||
export = { | ||
extends: ['./configs/base', './configs/eslint-recommended'], | ||
rules: { | ||
'@typescript-eslint/await-thenable': 'error', | ||
'@typescript-eslint/no-array-delete': 'error', | ||
'@typescript-eslint/no-base-to-string': 'error', | ||
'@typescript-eslint/no-confusing-void-expression': 'error', | ||
'@typescript-eslint/no-duplicate-type-constituents': 'error', | ||
'@typescript-eslint/no-floating-promises': 'error', | ||
'@typescript-eslint/no-for-in-array': 'error', | ||
'no-implied-eval': 'off', | ||
'@typescript-eslint/no-implied-eval': 'error', | ||
'@typescript-eslint/no-meaningless-void-operator': 'error', | ||
'@typescript-eslint/no-misused-promises': 'error', | ||
'@typescript-eslint/no-mixed-enums': 'error', | ||
'@typescript-eslint/no-redundant-type-constituents': 'error', | ||
'no-throw-literal': 'off', | ||
'@typescript-eslint/no-throw-literal': 'error', | ||
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', | ||
'@typescript-eslint/no-unnecessary-condition': 'error', | ||
'@typescript-eslint/no-unnecessary-type-arguments': 'error', | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'error', | ||
'@typescript-eslint/no-unsafe-argument': 'error', | ||
'@typescript-eslint/no-unsafe-assignment': 'error', | ||
'@typescript-eslint/no-unsafe-call': 'error', | ||
'@typescript-eslint/no-unsafe-enum-comparison': 'error', | ||
'@typescript-eslint/no-unsafe-member-access': 'error', | ||
'@typescript-eslint/no-unsafe-return': 'error', | ||
'@typescript-eslint/no-useless-template-literals': 'error', | ||
'@typescript-eslint/prefer-includes': 'error', | ||
'prefer-promise-reject-errors': 'off', | ||
'@typescript-eslint/prefer-promise-reject-errors': 'error', | ||
'@typescript-eslint/prefer-reduce-type-parameter': 'error', | ||
'@typescript-eslint/prefer-return-this-type': 'error', | ||
'require-await': 'off', | ||
'@typescript-eslint/require-await': 'error', | ||
'@typescript-eslint/restrict-plus-operands': 'error', | ||
'@typescript-eslint/restrict-template-expressions': 'error', | ||
'@typescript-eslint/unbound-method': 'error', | ||
}, | ||
} satisfies ClassicConfig.Config; |
20 changes: 20 additions & 0 deletions
20
packages/eslint-plugin/src/configs/stylistic-type-checked-only.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// THIS CODE WAS AUTOMATICALLY GENERATED | ||
// DO NOT EDIT THIS CODE BY HAND | ||
// SEE https://typescript-eslint.io/users/configs | ||
// | ||
// For developers working in the typescript-eslint monorepo: | ||
// You can regenerate it using `yarn generate:configs` | ||
|
||
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; | ||
|
||
export = { | ||
extends: ['./configs/base', './configs/eslint-recommended'], | ||
rules: { | ||
'dot-notation': 'off', | ||
'@typescript-eslint/dot-notation': 'error', | ||
'@typescript-eslint/non-nullable-type-assertion-style': 'error', | ||
'@typescript-eslint/prefer-nullish-coalescing': 'error', | ||
'@typescript-eslint/prefer-optional-chain': 'error', | ||
'@typescript-eslint/prefer-string-starts-ends-with': 'error', | ||
}, | ||
} satisfies ClassicConfig.Config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/typescript-eslint/src/configs/recommended-type-checked-only.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// THIS CODE WAS AUTOMATICALLY GENERATED | ||
// DO NOT EDIT THIS CODE BY HAND | ||
// SEE https://typescript-eslint.io/users/configs | ||
// | ||
// For developers working in the typescript-eslint monorepo: | ||
// You can regenerate it using `yarn generate:configs` | ||
|
||
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; | ||
|
||
import baseConfig from './base'; | ||
import eslintRecommendedConfig from './eslint-recommended'; | ||
|
||
export default ( | ||
plugin: FlatConfig.Plugin, | ||
parser: FlatConfig.Parser, | ||
): FlatConfig.ConfigArray => [ | ||
baseConfig(plugin, parser), | ||
eslintRecommendedConfig(plugin, parser), | ||
{ | ||
rules: { | ||
'@typescript-eslint/await-thenable': 'error', | ||
'@typescript-eslint/no-base-to-string': 'error', | ||
'@typescript-eslint/no-duplicate-type-constituents': 'error', | ||
'@typescript-eslint/no-floating-promises': 'error', | ||
'@typescript-eslint/no-for-in-array': 'error', | ||
'no-implied-eval': 'off', | ||
'@typescript-eslint/no-implied-eval': 'error', | ||
'@typescript-eslint/no-misused-promises': 'error', | ||
'@typescript-eslint/no-redundant-type-constituents': 'error', | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'error', | ||
'@typescript-eslint/no-unsafe-argument': 'error', | ||
'@typescript-eslint/no-unsafe-assignment': 'error', | ||
'@typescript-eslint/no-unsafe-call': 'error', | ||
'@typescript-eslint/no-unsafe-enum-comparison': 'error', | ||
'@typescript-eslint/no-unsafe-member-access': 'error', | ||
'@typescript-eslint/no-unsafe-return': 'error', | ||
'require-await': 'off', | ||
'@typescript-eslint/require-await': 'error', | ||
'@typescript-eslint/restrict-plus-operands': 'error', | ||
'@typescript-eslint/restrict-template-expressions': 'error', | ||
'@typescript-eslint/unbound-method': 'error', | ||
}, | ||
}, | ||
]; |
59 changes: 59 additions & 0 deletions
59
packages/typescript-eslint/src/configs/strict-type-checked-only.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// THIS CODE WAS AUTOMATICALLY GENERATED | ||
// DO NOT EDIT THIS CODE BY HAND | ||
// SEE https://typescript-eslint.io/users/configs | ||
// | ||
// For developers working in the typescript-eslint monorepo: | ||
// You can regenerate it using `yarn generate:configs` | ||
|
||
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; | ||
|
||
import baseConfig from './base'; | ||
import eslintRecommendedConfig from './eslint-recommended'; | ||
|
||
export default ( | ||
plugin: FlatConfig.Plugin, | ||
parser: FlatConfig.Parser, | ||
): FlatConfig.ConfigArray => [ | ||
baseConfig(plugin, parser), | ||
eslintRecommendedConfig(plugin, parser), | ||
{ | ||
rules: { | ||
'@typescript-eslint/await-thenable': 'error', | ||
'@typescript-eslint/no-array-delete': 'error', | ||
'@typescript-eslint/no-base-to-string': 'error', | ||
'@typescript-eslint/no-confusing-void-expression': 'error', | ||
'@typescript-eslint/no-duplicate-type-constituents': 'error', | ||
'@typescript-eslint/no-floating-promises': 'error', | ||
'@typescript-eslint/no-for-in-array': 'error', | ||
'no-implied-eval': 'off', | ||
'@typescript-eslint/no-implied-eval': 'error', | ||
'@typescript-eslint/no-meaningless-void-operator': 'error', | ||
'@typescript-eslint/no-misused-promises': 'error', | ||
'@typescript-eslint/no-mixed-enums': 'error', | ||
'@typescript-eslint/no-redundant-type-constituents': 'error', | ||
'no-throw-literal': 'off', | ||
'@typescript-eslint/no-throw-literal': 'error', | ||
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', | ||
'@typescript-eslint/no-unnecessary-condition': 'error', | ||
'@typescript-eslint/no-unnecessary-type-arguments': 'error', | ||
'@typescript-eslint/no-unnecessary-type-assertion': 'error', | ||
'@typescript-eslint/no-unsafe-argument': 'error', | ||
'@typescript-eslint/no-unsafe-assignment': 'error', | ||
'@typescript-eslint/no-unsafe-call': 'error', | ||
'@typescript-eslint/no-unsafe-enum-comparison': 'error', | ||
'@typescript-eslint/no-unsafe-member-access': 'error', | ||
'@typescript-eslint/no-unsafe-return': 'error', | ||
'@typescript-eslint/no-useless-template-literals': 'error', | ||
'@typescript-eslint/prefer-includes': 'error', | ||
'prefer-promise-reject-errors': 'off', | ||
'@typescript-eslint/prefer-promise-reject-errors': 'error', | ||
'@typescript-eslint/prefer-reduce-type-parameter': 'error', | ||
'@typescript-eslint/prefer-return-this-type': 'error', | ||
'require-await': 'off', | ||
'@typescript-eslint/require-await': 'error', | ||
'@typescript-eslint/restrict-plus-operands': 'error', | ||
'@typescript-eslint/restrict-template-expressions': 'error', | ||
'@typescript-eslint/unbound-method': 'error', | ||
}, | ||
}, | ||
]; |
29 changes: 29 additions & 0 deletions
29
packages/typescript-eslint/src/configs/stylistic-type-checked-only.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// THIS CODE WAS AUTOMATICALLY GENERATED | ||
// DO NOT EDIT THIS CODE BY HAND | ||
// SEE https://typescript-eslint.io/users/configs | ||
// | ||
// For developers working in the typescript-eslint monorepo: | ||
// You can regenerate it using `yarn generate:configs` | ||
|
||
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; | ||
|
||
import baseConfig from './base'; | ||
import eslintRecommendedConfig from './eslint-recommended'; | ||
|
||
export default ( | ||
plugin: FlatConfig.Plugin, | ||
parser: FlatConfig.Parser, | ||
): FlatConfig.ConfigArray => [ | ||
baseConfig(plugin, parser), | ||
eslintRecommendedConfig(plugin, parser), | ||
{ | ||
rules: { | ||
'dot-notation': 'off', | ||
'@typescript-eslint/dot-notation': 'error', | ||
'@typescript-eslint/non-nullable-type-assertion-style': 'error', | ||
'@typescript-eslint/prefer-nullish-coalescing': 'error', | ||
'@typescript-eslint/prefer-optional-chain': 'error', | ||
'@typescript-eslint/prefer-string-starts-ends-with': 'error', | ||
}, | ||
}, | ||
]; |