/
.eslintrc.json
75 lines (69 loc) · 2.18 KB
/
.eslintrc.json
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
{
"env": {
"node": true,
"es6": true
},
"plugins": ["node", "import"],
"extends": [
"eslint:recommended",
"plugin:node/recommended",
"plugin:import/recommended"
],
"rules": {
// -------------------
// Relaxing some rules
// -------------------
"no-console": "off",
"no-process-exit": "off",
// ----------------------------------
// Adding more eslint rules as errors
// ----------------------------------
// Disallow Unused Variables
// https://eslint.org/docs/rules/no-unused-vars
"no-unused-vars": ["error", { "vars": "all" }],
// require using arrow functions as callbacks
// https://eslint.org/docs/rules/prefer-arrow-callback
"prefer-arrow-callback": "error",
// require using template literals instead of string concatenation
// http://eslint.org/docs/rules/prefer-template
"prefer-template": "error",
// require using of const declaration for variables that are never modified after declared
// https://eslint.org/docs/rules/prefer-const
"prefer-const": "error",
// disallow modifying variables that are declared using const
// https://eslint.org/docs/rules/no-const-assign
"no-const-assign": "error",
// require let or const instead of var
// https://eslint.org/docs/rules/no-var
"no-var": "error",
// ------------------------------------
// Adding more eslint rules as warnings
// ------------------------------------
// require at least one whitespace after comments( // and /*)
// https://eslint.org/docs/rules/spaced-comment
"spaced-comment": ["warn", "always"],
// Require Following Curly Brace Conventions
// https://eslint.org/docs/rules/curly
"curly": ["warn", "all"],
// Require empty lines after class members
// https://eslint.org/docs/rules/lines-between-class-members
"lines-between-class-members": [
"warn",
"always",
{ "exceptAfterSingleLine": true }
],
"import/order": [
"warn",
{
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"newlines-between": "always"
}
]
},
"parserOptions": {
"ecmaVersion": 2018
}
}