-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc.js
100 lines (89 loc) · 2.23 KB
/
.eslintrc.js
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
89
90
91
92
93
94
95
96
97
98
99
100
// TODO: Add eslint-import-plugin
// TODO: Separate TypeScript config
// TODO: Separate test config
module.exports = {
env: {
node: true,
browser: true,
commonjs: true,
es6: true,
},
extends: [
'eslint:recommended',
// import
'plugin:import/recommended',
'plugin:import/typescript',
// react
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
// TypeScript
'plugin:@typescript-eslint/recommended',
// Test
'plugin:jest/recommended',
// prettier
'plugin:prettier/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
settings: {
react: {
version: 'detect',
},
},
rules: {
strict: 'error',
'one-var': ['error', 'never'],
'check-constructor': 'off',
'no-comma-dangle': 'off',
'no-empty-interface': 'off',
'no-unused-vars': 'off',
// import
'import/order': [
'warn',
{
groups: [
'builtin',
'external',
'internal',
'index',
'sibling',
'parent',
'object',
'type',
],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
// React
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-deprecated': 'error',
'react/display-name': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off', // For Next.js
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/anchor-is-valid': 'off', // For Next.js
// TypeScript
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
},
],
// Test
'jest/no-done-callback': 'warn',
},
}