-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
40 lines (39 loc) · 1.39 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import eslint from '@eslint/js';
import stylisticTs from '@stylistic/eslint-plugin-ts';
import hooksPlugin from 'eslint-plugin-react-hooks';
import tseslint from 'typescript-eslint';
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */
export default [
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
plugins: {
'@stylistic/ts': stylisticTs,
'react-hooks': hooksPlugin,
},
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'@typescript-eslint/ban-ts-comment': ['off'],
'@stylistic/ts/comma-dangle': ['error', 'always-multiline'],
'@stylistic/ts/member-delimiter-style': ['error'],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/restrict-template-expressions': ['error', {allowNumber: true}],
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@stylistic/ts/quotes': ['error', 'single', {allowTemplateLiterals: true}],
'no-param-reassign': 'error',
"react-hooks/rules-of-hooks":"error",
'react-hooks/exhaustive-deps': 'error',
},
}
];