-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
171 lines (170 loc) · 4.63 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
'use strict';
module.exports = {
env: {
browser: true,
node: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
requireConfigFile: false,
sourceType: 'module',
},
extends: [
'eslint:recommended',
'airbnb',
'plugin:jsx-a11y/recommended',
'prettier',
'plugin:jsdoc/recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: [
'@babel',
'jsx-a11y',
'prettier',
'jsdoc',
'react-hooks',
'testing-library',
'jest-dom',
'simple-import-sort',
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
// .jsx rules
'react/jsx-filename-extension': [
1,
{extensions: ['.js', '.jsx', '.ts', '.tsx']},
],
'import/extensions': 'off',
'react/jsx-indent': ['error', 2],
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': ['error'],
'react-hooks/exhaustive-deps': ['warn'],
// .js rules
'strict': 'off',
'semi': ['error', 'always'],
'indent': [
'error',
2,
{
ignoredNodes: ['JSXElement'],
SwitchCase: 1,
},
],
'init-declarations': 'off',
'no-undef-init': 'off',
'comma-dangle': ['error', 'always-multiline'],
'brace-style': ['error', '1tbs'],
'multiline-comment-style': ['error', 'separate-lines'],
'dot-notation': 'off',
'quote-props': ['error', 'consistent'],
'no-multi-spaces': ['error', {ignoreEOLComments: true}],
'no-whitespace-before-property': 'error',
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
'no-spaced-func': 'off',
'func-call-spacing': ['error', 'never'],
'func-names': 'off',
'block-spacing': ['error', 'always'],
'keyword-spacing': ['error', {before: true, after: true}],
'object-curly-spacing': ['error', 'never'],
'object-curly-newline': ['error', {consistent: true}],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'space-in-parens': 'error',
'no-nested-ternary': 'error',
'padded-blocks': ['error', 'never'],
'eol-last': ['error', 'always'],
'semi-style': ['error', 'last'],
'eqeqeq': 'error',
'quotes': ['error', 'single', {avoidEscape: true}],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'new-parens': 'error',
'new-cap': ['error'],
'no-var': 'error',
'prefer-const': [
'error',
{
destructuring: 'any',
ignoreReadBeforeAssign: false,
},
],
'no-warning-comments': ['warn', {terms: ['fixme']}],
'lines-between-class-members': 'error',
'no-multiple-empty-lines': ['error', {max: 1}],
'import/newline-after-import': ['off', {count: 1}],
'prefer-template': 'off',
'curly': ['error', 'all'],
'no-plusplus': 'off',
'no-restricted-properties': 'off',
'prefer-destructuring': 'off',
'class-methods-use-this': 'off',
'no-param-reassign': 'off',
'max-len': 'off',
'no-return-await': 'off',
'array-bracket-spacing': 'off',
'radix': 'off',
'camelcase': 'off',
'no-lonely-if': 'off',
'no-mixed-operators': 'off',
'no-shadow': 'off',
'no-useless-concat': 'off',
'no-continue': 'off',
'no-else-return': 'off',
'no-unneeded-ternary': 'off',
'operator-assignment': 'off',
'no-underscore-dangle': 'off',
'consistent-return': 'off',
'no-await-in-loop': 'off',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
'arrow-spacing': ['warn', {before: true, after: true}],
'arrow-parens': ['error', 'always'],
'key-spacing': ['error', {beforeColon: false, afterColon: true}],
'comma-spacing': ['warn', {before: false, after: true}],
'import/no-extraneous-dependencies': ['error', {devDependencies: true}],
'import/prefer-default-export': 'off',
'jsdoc/require-jsdoc': 'off',
'@typescript-eslint/type-annotation-spacing': [
'error',
{
before: false,
after: true,
overrides: {
arrow: {
before: true,
},
},
},
],
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: true,
},
multilineDetection: 'brackets',
},
],
'@typescript-eslint/object-curly-spacing': ['error', 'never'],
},
};