-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
executable file
·75 lines (75 loc) · 1.82 KB
/
.eslintrc.js
File metadata and controls
executable file
·75 lines (75 loc) · 1.82 KB
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
module.exports = {
extends: ['airbnb', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
jsx: true,
useJSXTextNode: true,
},
plugins: ['@typescript-eslint', 'prettier', 'react-hooks'],
env: {
browser: true,
node: true,
jest: true,
es6: true,
},
rules: {
'prettier/prettier': 2,
'no-param-reassign': 0,
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'react/prop-types': 0,
'@typescript-eslint/no-use-before-define': 'off',
'no-nested-ternary': 'off',
'react/jsx-filename-extension': 0,
'no-console': 0,
'import/no-named-as-default': 0,
'consistent-return': 0,
'react/jsx-props-no-spreading': 0,
'react-hooks/rules-of-hooks': 'error', // 檢查 Hook 的規則
'react-hooks/exhaustive-deps': 'warn', // 檢查 effect 的相依性
'react/function-component-definition': [
2,
{
namedComponents: ['arrow-function', 'function-expression'],
unnamedComponents: ['arrow-function', 'function-expression'],
},
],
'react/require-default-props': 0, // Since we do not use prop-types
'jsx-a11y/label-has-associated-control': [
'error',
{
required: {
some: ['nesting', 'id'],
},
},
],
'jsx-a11y/label-has-for': [
'error',
{
required: {
some: ['nesting', 'id'],
},
},
],
},
settings: {
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
};