-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.eslintrc.js
152 lines (151 loc) · 5.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
// project: "./tsconfig.json"
},
extends: ['airbnb', 'plugin:@typescript-eslint/recommended', 'plugin:import/typescript', 'plugin:react/recommended', 'plugin:react-hooks/recommended'],
plugins: ['react', 'react-hooks'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src/'],
},
},
},
globals: {
document: true, window: true, Fragment: true,
},
overrides: [{
files: ['**/*.test.js', '**/*.test.jsx', '**/*.stories.jsx'],
env: {
jest: true,
},
plugins: ['jest'],
rules: {
'no-console': 0,
'jest/no-standalone-expect': 0,
'import/no-extraneous-dependencies': 0,
'import/no-default-export': 0,
},
}],
rules: {
'arrow-parens': ['error', 'always'],
'consistent-return': 'off',
'func-names': ['error', 'as-needed'],
'import/exports-last': 'off',
'import/group-exports': 'off',
'import/no-cycle': 'off',
'import/extensions': 'off',
'import/no-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-named-as-default': 2,
'import/order': ['error', {
'newlines-between': 'always',
groups: [['builtin', 'external'], ['internal', 'parent', 'sibling', 'index']],
}],
'import/prefer-default-export': 'off',
'jest/expect-expect': 'off',
'jest/no-disabled-tests': 'off',
'jsx-a11y/accessible-emoji': 'off',
'jsx-a11y/alt-text': 'off',
'jsx-a11y/anchor-has-content': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/aria-activedescendant-has-tabindex': 'off',
'jsx-a11y/aria-props': 'off',
'jsx-a11y/aria-proptypes': 'off',
'jsx-a11y/aria-role': 'off',
'jsx-a11y/aria-unsupported-elements': 'off',
'jsx-a11y/autocomplete-valid': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/heading-has-content': 'off',
'jsx-a11y/html-has-lang': 'off',
'jsx-a11y/iframe-has-title': 'off',
'jsx-a11y/img-redundant-alt': 'off',
'jsx-a11y/interactive-supports-focus': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/media-has-caption': 'off',
'jsx-a11y/mouse-events-have-key-events': 'off',
'jsx-a11y/no-access-key': 'off',
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/no-distracting-elements': 'off',
'jsx-a11y/no-interactive-element-to-noninteractive-role': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'off',
'jsx-a11y/no-noninteractive-tabindex': 'off',
'jsx-a11y/no-onchange': 'off',
'jsx-a11y/no-redundant-roles': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/role-has-required-aria-props': 'off',
'jsx-a11y/role-supports-aria-props': 'off',
'jsx-a11y/scope': 'off',
'jsx-a11y/tabindex-no-positive': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'react/jsx-filename-extension': 'off',
'max-len': 'off',
'max-params': ['error', 3],
'no-await-in-loop': 'off',
'no-cond-assign': 'off',
'no-console': 'off',
'no-continue': 'off',
'no-delete-var': 'error',
'no-empty': 0,
'no-extra-boolean-cast': 0,
'no-plusplus': 'off',
'no-prototype-builtins': 'off',
'no-nested-ternary': 'off',
'no-restricted-properties': 'off',
'no-restricted-syntax': 'off',
'no-promise-executor-return': 'off',
'no-unused-vars': ['off', {
varsIgnorePattern: 'Fragment', ignoreRestSiblings: true,
}],
'linebreak-style': 0,
'@typescript-eslint/no-unused-vars': 'off',
'no-use-before-define': 'off',
'object-curly-newline': ['error', {
ObjectExpression: { consistent: true },
ObjectPattern: 'never',
ImportDeclaration: 'never',
ExportDeclaration: {
multiline: true, minProperties: 3,
},
}],
'object-curly-spacing': ['error', 'always', {
arraysInObjects: true, objectsInObjects: true,
}],
'react-hooks/exhaustive-deps': 0, // Checks effect dependencies
'react-hooks/rules-of-hooks': 'error',
'react/button-has-type': 'off',
'react/destructuring-assignment': 'off',
'react/display-name': 0,
'react/forbid-prop-types': 'off',
'react/function-component-definition': 'off',
'react/jsx-curly-brace-presence': 'off',
'react/jsx-first-prop-new-line': 'off',
'react/jsx-fragments': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-uses-react': 1,
'react/jsx-uses-vars': 1,
'react/no-array-index-key': 'off',
'react/no-did-update-set-state': 'off',
'react/no-unused-state': 'off',
'react/prop-types': [2, { skipUndeclared: true }],
'react/react-in-jsx-scope': 0,
'react/require-default-props': 0,
'require-atomic-updates': 'off',
'require-await': 2,
camelcase: 'error',
curly: ['error', 'all'],
'default-param-last': 'off',
indent: ['error', 2, { SwitchCase: 1 }],
quotes: ['error', 'single'],
semi: ['error', 'always'],
},
};