-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
73 lines (67 loc) · 1.43 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
/* eslint-env node */
module.exports = {
env: {
browser: true,
es6: true,
},
plugins: [
'import',
'no-unsanitized',
'react-hooks',
'jam3', // for dangerouslySetInnerHTML
],
extends: ['eslint:recommended', 'plugin:react/recommended'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
jsx: true,
},
rules: {
complexity: ['error', { max: 10 }],
indent: ['error', 'tab', { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
'max-depth': ['error', 4],
'max-len': ['error', { code: 150 }],
'max-lines': [
'error',
{ max: 300, skipBlankLines: true, skipComments: true },
],
'max-params': ['warn', { max: 4 }],
'no-shadow': ['error', { builtinGlobals: true }],
semi: ['error', 'always'],
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'lodash',
message:
'Please do not import lodash as a whole: import individual lodash functions instead.',
},
],
},
],
'jam3/no-sanitizer-with-danger': [
'error',
{ wrapperName: ['escapeHTML'] },
],
'no-unsanitized/property': [
'error',
{ escape: { methods: ['escapeHTML'] } },
],
'no-unsanitized/method': ['error'],
'react/prop-types': ['off'],
'react-hooks/rules-of-hooks': ['error'],
'react-hooks/exhaustive-deps': ['warn'],
},
settings: {
react: {
pragma: 'React',
version: 'detect',
},
},
};