-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
53 lines (53 loc) · 1.72 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:react-hooks/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime', // https://github.com/jsx-eslint/eslint-plugin-react#configuration-legacy-eslintrc-
],
ignorePatterns: ['dist', '.eslintrc.cjs', 'vite.config.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
plugins: ['react-refresh', 'import', 'unused-imports'],
overrides: [
{
files: ['*.test.*'],
rules: {
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/unbound-method.md
// https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md
'@typescript-eslint/unbound-method': 'off',
}
}
],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'unused-imports/no-unused-imports': 'warn',
'import/order': [
'warn',
{
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
'newlines-between': 'always',
'pathGroupsExcludedImportTypes': ['builtin'],
'alphabetize': { 'order': 'asc', 'caseInsensitive': true },
'pathGroups': []
}
]
},
settings: {
'import/resolver': { typescript: {} },
'react': {
'version': 'detect', // React version. "detect" automatically picks the version you have installed.
},
}
}