-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mts
84 lines (83 loc) · 3.01 KB
/
eslint.config.mts
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// @ts-nocheck
import js from '@eslint/js';
import vitest from '@vitest/eslint-plugin';
import eslintConfigPrettier from 'eslint-config-prettier';
import { flatConfigs } from 'eslint-plugin-import';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import nodePlugin from 'eslint-plugin-n';
import noRelativeImportPaths from 'eslint-plugin-no-relative-import-paths';
import pluginPromise from 'eslint-plugin-promise';
import reactPlugin from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config({
extends: [
js.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
flatConfigs.recommended,
nodePlugin.configs['flat/recommended-module'],
pluginPromise.configs['flat/recommended'],
jsxA11y.flatConfigs.strict,
eslintConfigPrettier
],
files: ['**/*.{ts,tsx}'],
settings: {
react: { version: 'detect' },
'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx'] },
'import/resolver': { typescript: true, node: true }
},
languageOptions: {
globals: {
...globals.serviceworker,
...globals.browser,
...globals.es2024
},
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
projectService: true
}
},
plugins: {
'no-relative-import-paths': noRelativeImportPaths,
'react-hooks': reactHooks,
'react-refresh': reactRefresh
},
rules: {
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/explicit-member-accessibility': 2,
'@typescript-eslint/explicit-function-return-type': 2,
'@typescript-eslint/consistent-type-imports': [2, { fixStyle: 'inline-type-imports' }],
'no-relative-import-paths/no-relative-import-paths': [2, { rootDir: 'src', prefix: '@' }],
'import/order': [2, { 'newlines-between': 'always', alphabetize: { order: 'asc' } }],
'import/consistent-type-specifier-style': [2, 'prefer-inline'],
'import/extensions': [2, 'ignorePackages'],
'import/no-named-as-default-member': 0,
'import/no-useless-path-segments': 2,
'import/no-named-as-default': 0,
'import/no-default-export': 2,
'import/group-exports': 2,
'react/sort-comp': 2,
'react/jsx-pascal-case': 2,
'react/prefer-es6-class': 2,
'react/jsx-boolean-value': 2,
'react/self-closing-comp': 2,
'react/no-unknown-property': 0,
'react/prefer-stateless-function': 2,
'react/no-multi-comp': [2, { 'ignoreStateless': true }],
'react/jsx-no-bind': [2, { 'allowArrowFunctions': true }],
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': 2,
'jest/no-deprecated-functions': 0,
'n/no-missing-import': 0,
'no-unused-vars': 0,
'prefer-const': 2,
eqeqeq: 2
}
}) satisfies FlatConfig.ConfigArray;