-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
executable file
·90 lines (88 loc) · 3.04 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
module.exports = {
root: true,
extends: ['airbnb', 'airbnb/hooks'],
parser: '@babel/eslint-parser',
env: {
browser: true,
jest: true,
},
settings: {
'import/resolver': {
webpack: { config: './config/webpack.config.js' },
},
},
rules: {
// enable rules
'react/jsx-key': 2,
'object-curly-newline': [2, {
ObjectExpression: { minProperties: 4, multiline: true, consistent: true },
ObjectPattern: { minProperties: 4, multiline: true, consistent: true },
}],
'import/order': [2, {
'pathGroups': [
{ pattern: 'react', group: 'builtin', position: 'before' },
{ pattern: '@mui/**', group: 'external', position: 'after' },
{ pattern: '@fortawesome/**', group: 'external', position: 'after' },
{ pattern: 'react-bulma-companion/**', group: 'external', position: 'after' },
{ pattern: '_client/**', group: 'internal', position: 'after' },
{ pattern: '_components/**', group: 'internal', position: 'after' },
{ pattern: '_store/**', group: 'internal', position: 'after' },
{ pattern: '_styles/**', group: 'internal', position: 'after' },
{ pattern: '_hooks/**', group: 'internal', position: 'after' },
{ pattern: '_utils/**', group: 'internal', position: 'after' },
],
'pathGroupsExcludedImportTypes': ['react'],
'alphabetize': {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
}],
'sort-imports': [2, {
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
allowSeparatedGroups: true,
}],
// override defaults
'eqeqeq': [2, 'smart'],
'max-len': [2, { code: 120, tabWidth: 2, ignoreUrls: true }],
'newline-per-chained-call': [2, { ignoreChainWithDepth: 4 }],
'no-cond-assign': [2, 'except-parens'],
'no-multi-spaces': [2, {
exceptions: {
ImportDeclaration: true,
Property: true,
VariableDeclarator: true,
},
}],
'quote-props': [2, 'consistent-as-needed'],
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx'] }],
'react/jsx-fragments': [2, 'element'],
// disable rules
'arrow-parens': 0,
'default-param-last': 0,
'function-paren-newline': 0,
'implicit-arrow-linebreak': 0,
'import/no-cycle': 0,
'import/no-extraneous-dependencies': 0,
'import/no-named-as-default': 0,
'import/prefer-default-export': 0,
'jsx-a11y/anchor-is-valid': 0,
'jsx-a11y/label-has-associated-control': 0,
'jsx-a11y/label-has-for': 0,
'jsx-a11y/no-static-element-interactions': 0,
'no-confusing-arrow': 0,
'no-nested-ternary': 0,
'no-plusplus': 0,
'no-shadow': 0,
'no-underscore-dangle': 0,
'react/destructuring-assignment': 0,
'react/forbid-prop-types': 0,
'react/jsx-boolean-value': 0,
'react/jsx-props-no-spreading': 0,
'react/state-in-constructor': 0,
'react/static-property-placement': 0,
},
};