-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Update TypeScript Rules and Config to support ESLint v9 (#338)
* update deps * remove deleted rule * update config for flat * update snapshot * delete unnecessary dummy files * feat!: Update Node.js and TypeScript version requirement * update deps
- Loading branch information
Showing
17 changed files
with
694 additions
and
341 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,34 @@ | ||
// @ts-check | ||
import typescriptEslint from '@typescript-eslint/eslint-plugin'; | ||
import typescriptEslintParser from '@typescript-eslint/parser'; | ||
import tseslint from 'typescript-eslint'; | ||
import typescriptRuleSetBase from '../../rules/typescript.js'; | ||
|
||
const typescriptRuleSet = { | ||
plugins: { | ||
'@typescript-eslint': typescriptEslint, | ||
}, | ||
rules: { | ||
...typescriptEslint.configs['eslint-recommended'].overrides?.[0].rules, | ||
...typescriptEslint.configs['strict-type-checked'].rules, | ||
...typescriptEslint.configs['stylistic-type-checked'].rules, | ||
...typescriptRuleSetBase.rules, | ||
'@typescript-eslint': tseslint.plugin, | ||
}, | ||
extends: [ | ||
...tseslint.configs.strictTypeChecked, | ||
...tseslint.configs.stylisticTypeChecked, | ||
], | ||
rules: typescriptRuleSetBase.rules, | ||
}; | ||
|
||
export default [ | ||
{ | ||
files: ['**/*.@(ts|tsx|cts|mts)'], | ||
export default tseslint.config({ | ||
files: ['**/*.@(ts|tsx|cts|mts)'], | ||
|
||
languageOptions: { | ||
parser: typescriptEslintParser, | ||
parserOptions: { | ||
project: true, | ||
}, | ||
languageOptions: { | ||
parser: tseslint.parser, | ||
parserOptions: { | ||
projectService: true, | ||
tsconfigRootDir: process.env.TSCONFIG_ROOT_DIR ?? import.meta.dirname, | ||
}, | ||
}, | ||
|
||
settings: { | ||
// https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#importparsers | ||
'import/parsers': { | ||
'@typescript-eslint/parser': ['.ts', '.tsx', '.cts', '.mts'], | ||
}, | ||
settings: { | ||
// https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#importparsers | ||
'import/parsers': { | ||
'@typescript-eslint/parser': ['.ts', '.tsx', '.cts', '.mts'], | ||
}, | ||
|
||
...typescriptRuleSet, | ||
}, | ||
]; | ||
|
||
...typescriptRuleSet, | ||
}); |
Oops, something went wrong.