mirror of
https://github.com/scratchfoundation/eslint-config-scratch.git
synced 2025-07-26 14:12:50 -04:00
fix: don't try to check types in JS
This commit is contained in:
parent
497bd2880b
commit
329b4de61c
1 changed files with 20 additions and 24 deletions
|
@ -93,20 +93,8 @@ const makeEslintConfig = ({ tsconfigRootDir, globals: globalsIn } = {}, ...moreC
|
|||
return tseslint.config(
|
||||
// Start with recommended rules from ESLint and TypeScript ESLint.
|
||||
{
|
||||
extends: [
|
||||
eslint.configs.recommended,
|
||||
tsconfigRootDir ? tseslint.configs.recommendedTypeChecked : tseslint.configs.recommended,
|
||||
tsconfigRootDir ? tseslint.configs.stylisticTypeChecked : tseslint.configs.stylistic,
|
||||
],
|
||||
extends: [eslint.configs.recommended, tseslint.configs.recommended, tseslint.configs.stylistic],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
...(tsconfigRootDir
|
||||
? {
|
||||
projectService: true,
|
||||
tsconfigRootDir,
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
...(globalsIn ? { globals: flattenedGlobals } : {}),
|
||||
},
|
||||
},
|
||||
|
@ -229,19 +217,27 @@ const makeEslintConfig = ({ tsconfigRootDir, globals: globalsIn } = {}, ...moreC
|
|||
|
||||
// https://typescript-eslint.io/rules/no-non-null-assertion
|
||||
'@typescript-eslint/no-non-null-assertion': ['error'],
|
||||
|
||||
// Rules that require type information
|
||||
...(tsconfigRootDir
|
||||
? {
|
||||
// https://typescript-eslint.io/rules/no-unnecessary-condition/
|
||||
'@typescript-eslint/no-unnecessary-condition': ['error'],
|
||||
|
||||
// https://typescript-eslint.io/rules/require-await/
|
||||
'@typescript-eslint/require-await': ['error'],
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
},
|
||||
tsconfigRootDir
|
||||
? {
|
||||
files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'],
|
||||
extends: [tseslint.configs.recommendedTypeChecked, tseslint.configs.stylisticTypeChecked],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// https://typescript-eslint.io/rules/no-unnecessary-condition/
|
||||
'@typescript-eslint/no-unnecessary-condition': ['error'],
|
||||
|
||||
// https://typescript-eslint.io/rules/require-await/
|
||||
'@typescript-eslint/require-await': ['error'],
|
||||
},
|
||||
}
|
||||
: {},
|
||||
// @eslint-community/eslint-plugin-eslint-comments
|
||||
{
|
||||
extends: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue