-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslintrc.js
127 lines (126 loc) · 3.07 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
"use strict";
module.exports = {
parserOptions: {
ecmaVersion: 2019,
},
env: {
es6: true,
node: true,
},
plugins: ["eslint-comments", "jest", "node", "sort-requires"],
extends: [
"eslint:recommended",
"plugin:eslint-comments/recommended",
"plugin:node/recommended",
"plugin:jest/recommended",
"plugin:jest/style",
"prettier",
],
rules: {
"array-callback-return": "error",
"dot-notation": "error",
eqeqeq: ["error", "smart"],
"eslint-comments/no-unused-disable": "error",
"func-name-matching": "error",
"guard-for-in": "error",
"no-confusing-arrow": [
"error",
{
allowParens: false,
},
],
"no-console": "error",
"no-else-return": [
"error",
{
allowElseIf: false,
},
],
"no-implicit-coercion": "error",
"no-lonely-if": "error",
"no-shadow": "error",
"no-unneeded-ternary": "error",
"no-unused-vars": [
"error",
{
ignoreRestSiblings: true,
},
],
"no-use-before-define": ["error", "nofunc"],
"no-useless-return": "error",
"no-var": "error",
"node/no-unsupported-features/es-builtins": [
"error",
{
version: ">=10.18.0",
},
],
"node/no-unsupported-features/es-syntax": [
"error",
{
version: ">=10.18.0",
},
],
"node/no-unsupported-features/node-builtins": [
"error",
{
version: ">=10.18.0",
},
],
"object-shorthand": "error",
"one-var": ["error", "never"],
"operator-assignment": "error",
"padding-line-between-statements": [
"error",
// Require blank lines after all directive prologues (e. g. 'use strict')
{
blankLine: "always",
prev: "directive",
next: "*",
},
// Disallow blank lines between all directive prologues (e. g. 'use strict')
{
blankLine: "never",
prev: "directive",
next: "directive",
},
// Require blank lines after every sequence of variable declarations
{
blankLine: "always",
prev: ["const", "let", "var"],
next: "*",
},
// Blank lines could be between variable declarations
{
blankLine: "any",
prev: ["const", "let", "var"],
next: ["const", "let", "var"],
},
// Require blank lines before all return statements
{
blankLine: "always",
prev: "*",
next: "return",
},
// Require blank lines before and after all following statements
{
blankLine: "always",
prev: "*",
next: ["for", "function", "if", "switch", "try"],
},
{
blankLine: "always",
prev: ["for", "function", "if", "switch", "try"],
next: "*",
},
],
"prefer-arrow-callback": "error",
"prefer-object-spread": "error",
"prefer-regex-literals": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"sort-requires/sort-requires": "error",
strict: ["error", "global"],
},
};