mirror of
https://github.com/scratchfoundation/eslint-config-scratch.git
synced 2025-08-28 22:40:13 -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(
|
return tseslint.config(
|
||||||
// Start with recommended rules from ESLint and TypeScript ESLint.
|
// Start with recommended rules from ESLint and TypeScript ESLint.
|
||||||
{
|
{
|
||||||
extends: [
|
extends: [eslint.configs.recommended, tseslint.configs.recommended, tseslint.configs.stylistic],
|
||||||
eslint.configs.recommended,
|
|
||||||
tsconfigRootDir ? tseslint.configs.recommendedTypeChecked : tseslint.configs.recommended,
|
|
||||||
tsconfigRootDir ? tseslint.configs.stylisticTypeChecked : tseslint.configs.stylistic,
|
|
||||||
],
|
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
parserOptions: {
|
|
||||||
...(tsconfigRootDir
|
|
||||||
? {
|
|
||||||
projectService: true,
|
|
||||||
tsconfigRootDir,
|
|
||||||
}
|
|
||||||
: {}),
|
|
||||||
},
|
|
||||||
...(globalsIn ? { globals: flattenedGlobals } : {}),
|
...(globalsIn ? { globals: flattenedGlobals } : {}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -229,19 +217,27 @@ const makeEslintConfig = ({ tsconfigRootDir, globals: globalsIn } = {}, ...moreC
|
||||||
|
|
||||||
// https://typescript-eslint.io/rules/no-non-null-assertion
|
// https://typescript-eslint.io/rules/no-non-null-assertion
|
||||||
'@typescript-eslint/no-non-null-assertion': ['error'],
|
'@typescript-eslint/no-non-null-assertion': ['error'],
|
||||||
|
},
|
||||||
// Rules that require type information
|
},
|
||||||
...(tsconfigRootDir
|
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/
|
// https://typescript-eslint.io/rules/no-unnecessary-condition/
|
||||||
'@typescript-eslint/no-unnecessary-condition': ['error'],
|
'@typescript-eslint/no-unnecessary-condition': ['error'],
|
||||||
|
|
||||||
// https://typescript-eslint.io/rules/require-await/
|
// https://typescript-eslint.io/rules/require-await/
|
||||||
'@typescript-eslint/require-await': ['error'],
|
'@typescript-eslint/require-await': ['error'],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
: {}),
|
: {},
|
||||||
},
|
|
||||||
},
|
|
||||||
// @eslint-community/eslint-plugin-eslint-comments
|
// @eslint-community/eslint-plugin-eslint-comments
|
||||||
{
|
{
|
||||||
extends: [
|
extends: [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue