-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.cjs
88 lines (88 loc) · 1.92 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
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
85
86
87
88
module.exports = {
parser: '@typescript-eslint/parser',
env: {
browser: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@vitest/legacy-recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended',
'plugin:testing-library/react',
],
plugins: [
'react',
'react-hooks',
'@typescript-eslint',
'@vitest',
'import',
'jsx-a11y',
'prettier',
'@stylistic/js',
'testing-library',
],
settings: {
react: {
version: 'detect',
},
},
rules: {
'@stylistic/js/brace-style': ['error', '1tbs', { allowSingleLine: true }],
'no-use-before-define': 'off',
'react/prop-types': 'off',
'react/no-unused-prop-types': ['warn', { skipShapeProps: true }],
'array-bracket-spacing': ['warn', 'never'],
'import/order': [
'error',
{
groups: [
'builtin',
'external',
['internal', 'parent', 'sibling', 'index'],
],
'newlines-between': 'always',
},
],
'max-len': ['warn', { code: 120 }],
'no-console': 'warn',
'no-plusplus': 'error',
'no-undef': 'warn',
'object-curly-spacing': ['warn', 'always'],
'import/no-named-as-default': 'off',
'@vitest/expect-expect': [
'error',
{
assertFunctionNames: [
'expect',
't.expect', // browser tests use this form
],
},
],
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'no-undef': 'off',
},
},
{
files: ['**/__tests__/**/*.test.{ts,tsx}'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
],
globals: {
React: true,
JSX: true,
vi: true,
},
};