-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
72 lines (68 loc) · 1.94 KB
/
.eslintrc
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
{
"parserOptions": {
"requireConfigFile": false,
"ecmaVersion": "latest",
"sourceType": "module",
"allowImportExportEverywhere": true
},
"extends": "eslint:recommended",
"reportUnusedDisableDirectives": true,
"env": {
"node": true,
"es2021": true,
"mocha": true,
"browser": true
},
// Rules https://eslint.org/docs/rules/
"rules": {
// Possible errors
"no-console": "error",
// Variables
"init-declarations": "off",
"no-delete-var": "error",
"no-label-var": "error",
"no-restricted-globals": "off",
"no-shadow": "error",
"no-shadow-restricted-names": "error",
"no-undef": "error",
"no-undef-init": "error",
"no-undefined": "off",
"no-unused-vars": ["error", { "vars": "all", "args": "after-used" }],
"no-use-before-define": ["error", { "functions": false }],
// Best Practices
"complexity": ["warn", 5],
"consistent-return": "error",
"curly": ["error", "multi-line"],
"eqeqeq": "error",
"no-constructor-return": "error",
"no-empty-function": "error",
"no-eval": "error",
"no-implied-eval": "error",
"no-param-reassign": "error",
"no-proto": "error",
"no-return-await": "error",
"no-throw-literal": "error",
"no-void": "error",
"prefer-promise-reject-errors": "error",
"require-await": "error",
/*
* Stylistic
* Most stylistic rules should be handled by prettier.
* Check Prettier options BEFORE adding any eslint style rules
* https://prettier.io/docs/en/options.html
*/
"camelcase": "error",
"eol-last": ["error", "always"],
"func-style": ["error", "declaration"],
"max-params": ["error", 4],
// ES6
"no-duplicate-imports": "error",
"no-var": "error",
"prefer-arrow-callback": "error",
"prefer-const": "error",
"prefer-destructuring": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error"
}
}