generated from wednesday-solutions/react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
104 lines (101 loc) · 2.44 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
const fs = require('fs');
const path = require('path');
const prettierOptions = JSON.parse(fs.readFileSync(path.resolve(__dirname, '.prettierrc'), 'utf8'));
module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
es6: true,
amd: true,
'jest/globals': true,
commonjs: true
},
plugins: [
'react',
'redux-saga',
'react-hooks',
'jest',
"github",
"immutable",
"sonarjs"
],
extends: [
'prettier',
'prettier/react',
'prettier-standard',
'plugin:react/recommended',
'eslint:recommended',
"plugin:sonarjs/recommended",
'plugin:security/recommended-legacy',
"plugin:github/recommended"],
rules: {
'import/no-webpack-loader-syntax': 0,
'react/display-name': 0,
curly: ['error', 'all'],
'no-console': ['error', { allow: ['error'] }],
'max-lines': ['error', { max: 300, skipBlankLines: true, skipComments: true }],
'prettier/prettier': ['error', prettierOptions],
'no-restricted-imports': [
'error',
{
patterns: ['@mui/*/*/*']
}
],
"max-lines-per-function": ["error", 250],
"no-else-return": "error",
"max-params": ["error", 3],
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": false,
"ClassDeclaration": false,
"ArrowFunctionExpression": false,
"FunctionExpression": false,
},
}],
"no-shadow": "error",
"complexity": ["error", 5],
"no-empty": "error",
"import/order": ["error", { "groups": [["builtin", "external", "internal", "parent", "sibling", "index"]] }],
"immutable/no-this": 2,
"immutable/no-mutation": ['error', {
exceptions: [
{
object: "draft"
},
{
property: "propTypes"
},
{
property: 'defaultProps'
}
]
}],
"eslint-comments/no-use": 0,
"max-lines": ["error", 350],
},
globals: {
GLOBAL: false,
it: false,
expect: false,
describe: false
},
settings: {
"react": {
"version": "detect"
},
"import/resolver": {
"alias": {
map: [
["@app", "./app",],
["@images", "./app/images",],
["@components", "./app/components",],
["@containers", "./app/containers",],
["@utils", "./app/utils",],
["@services", "./app/services",],
["@themes", "./app/themes",]
]
}
}
}
};