@mimica/eslint-config 2.8.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +334 -0
- package/package.json +2 -2
package/index.mjs
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
|
|
4
|
+
import js from "@eslint/js";
|
|
5
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
6
|
+
|
|
7
|
+
import babelParser from "@babel/eslint-parser";
|
|
8
|
+
import eslintComments from "eslint-plugin-eslint-comments";
|
|
9
|
+
import unicorn from "eslint-plugin-unicorn";
|
|
10
|
+
import sonarjs from "eslint-plugin-sonarjs";
|
|
11
|
+
import promise from "eslint-plugin-promise";
|
|
12
|
+
import youDontNeedLodashUnderscore from "eslint-plugin-you-dont-need-lodash-underscore";
|
|
13
|
+
import inker from "eslint-plugin-inker";
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = path.dirname(__filename);
|
|
17
|
+
const compat = new FlatCompat({
|
|
18
|
+
baseDirectory: __dirname,
|
|
19
|
+
recommendedConfig: js.configs.recommended,
|
|
20
|
+
allConfig: js.configs.all,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default [
|
|
24
|
+
...compat.extends("airbnb-base"),
|
|
25
|
+
unicorn.configs["flat/recommended"],
|
|
26
|
+
{
|
|
27
|
+
plugins: {
|
|
28
|
+
sonarjs,
|
|
29
|
+
unicorn,
|
|
30
|
+
inker,
|
|
31
|
+
promise,
|
|
32
|
+
"you-dont-need-lodash-underscore": youDontNeedLodashUnderscore,
|
|
33
|
+
"eslint-comments": eslintComments,
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
languageOptions: {
|
|
37
|
+
globals: {},
|
|
38
|
+
parser: babelParser,
|
|
39
|
+
ecmaVersion: 5,
|
|
40
|
+
sourceType: "script",
|
|
41
|
+
|
|
42
|
+
parserOptions: {
|
|
43
|
+
requireConfigFile: false,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
rules: {
|
|
48
|
+
"arrow-parens": 0,
|
|
49
|
+
|
|
50
|
+
camelcase: [
|
|
51
|
+
1,
|
|
52
|
+
{
|
|
53
|
+
allow: [],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
|
|
57
|
+
"consistent-return": 0,
|
|
58
|
+
curly: [2, "all"],
|
|
59
|
+
"function-paren-newline": [0, "never"],
|
|
60
|
+
"guard-for-in": 1,
|
|
61
|
+
"implicit-arrow-linebreak": 0,
|
|
62
|
+
indent: 0,
|
|
63
|
+
|
|
64
|
+
"lines-between-class-members": [
|
|
65
|
+
2,
|
|
66
|
+
"always",
|
|
67
|
+
{
|
|
68
|
+
exceptAfterSingleLine: true,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
|
|
72
|
+
"max-params": 2,
|
|
73
|
+
"no-confusing-arrow": 0,
|
|
74
|
+
"no-console": 2,
|
|
75
|
+
"no-continue": 0,
|
|
76
|
+
"no-loop-func": 1,
|
|
77
|
+
|
|
78
|
+
"no-param-reassign": [
|
|
79
|
+
2,
|
|
80
|
+
{
|
|
81
|
+
props: false,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
|
|
85
|
+
"no-plusplus": 0,
|
|
86
|
+
|
|
87
|
+
"no-restricted-syntax": [
|
|
88
|
+
2,
|
|
89
|
+
"ForInStatement",
|
|
90
|
+
"LabeledStatement",
|
|
91
|
+
"WithStatement",
|
|
92
|
+
{
|
|
93
|
+
selector:
|
|
94
|
+
':matches(PropertyDefinition, MethodDefinition)[accessibility="private"]',
|
|
95
|
+
message: "Use #private instead.",
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
|
|
99
|
+
"no-underscore-dangle": 0,
|
|
100
|
+
"no-unused-private-class-members": 2,
|
|
101
|
+
|
|
102
|
+
"no-unused-vars": [
|
|
103
|
+
2,
|
|
104
|
+
{
|
|
105
|
+
args: "none",
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
|
|
109
|
+
"no-useless-escape": 2,
|
|
110
|
+
"object-curly-newline": 0,
|
|
111
|
+
"operator-linebreak": 0,
|
|
112
|
+
|
|
113
|
+
"padding-line-between-statements": [
|
|
114
|
+
2,
|
|
115
|
+
{
|
|
116
|
+
blankLine: "always",
|
|
117
|
+
prev: "*",
|
|
118
|
+
next: "function",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
blankLine: "always",
|
|
122
|
+
prev: "function",
|
|
123
|
+
next: "*",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
blankLine: "always",
|
|
127
|
+
prev: "*",
|
|
128
|
+
next: "class",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
blankLine: "always",
|
|
132
|
+
prev: "class",
|
|
133
|
+
next: "*",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
blankLine: "always",
|
|
137
|
+
prev: "cjs-export",
|
|
138
|
+
next: "*",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
blankLine: "always",
|
|
142
|
+
prev: "*",
|
|
143
|
+
next: "cjs-export",
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
|
|
147
|
+
"prefer-destructuring": [
|
|
148
|
+
2,
|
|
149
|
+
{
|
|
150
|
+
array: false,
|
|
151
|
+
object: true,
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
|
|
155
|
+
quotes: [0, "double"],
|
|
156
|
+
semi: [2, "always"],
|
|
157
|
+
"sonarjs/no-inverted-boolean-check": 2,
|
|
158
|
+
"sonarjs/prefer-immediate-return": 2,
|
|
159
|
+
"sonarjs/prefer-while": 2,
|
|
160
|
+
"unicorn/better-regex": 2,
|
|
161
|
+
|
|
162
|
+
"unicorn/catch-error-name": [
|
|
163
|
+
2,
|
|
164
|
+
{
|
|
165
|
+
name: "err",
|
|
166
|
+
ignore: ["error"],
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
|
|
170
|
+
"unicorn/consistent-destructuring": 2,
|
|
171
|
+
"unicorn/consistent-existence-index-check": 0,
|
|
172
|
+
"unicorn/consistent-function-scoping": 0,
|
|
173
|
+
"unicorn/custom-error-definition": 2,
|
|
174
|
+
"unicorn/empty-brace-spaces": 0,
|
|
175
|
+
"unicorn/explicit-length-check": 0,
|
|
176
|
+
"unicorn/filename-case": 0,
|
|
177
|
+
"unicorn/import-style": 0,
|
|
178
|
+
"unicorn/no-anonymous-default-export": 0,
|
|
179
|
+
"unicorn/no-array-callback-reference": 0,
|
|
180
|
+
|
|
181
|
+
"unicorn/no-array-reduce": [
|
|
182
|
+
2,
|
|
183
|
+
{
|
|
184
|
+
allowSimpleOperations: false,
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
|
|
188
|
+
"unicorn/no-nested-ternary": 0,
|
|
189
|
+
"unicorn/no-null": 0,
|
|
190
|
+
"unicorn/no-process-exit": 0,
|
|
191
|
+
"unicorn/no-useless-undefined": 0,
|
|
192
|
+
"unicorn/numeric-separators-style": 0,
|
|
193
|
+
"unicorn/prefer-add-event-listener": 0,
|
|
194
|
+
"unicorn/prefer-module": 0,
|
|
195
|
+
"unicorn/prefer-query-selector": 0,
|
|
196
|
+
"unicorn/prefer-set-has": 0,
|
|
197
|
+
"unicorn/prefer-spread": 0,
|
|
198
|
+
"unicorn/prefer-switch": 0,
|
|
199
|
+
"unicorn/prefer-ternary": 0,
|
|
200
|
+
"unicorn/prefer-top-level-await": 0,
|
|
201
|
+
"unicorn/prevent-abbreviations": 0,
|
|
202
|
+
"unicorn/switch-case-braces": 0,
|
|
203
|
+
|
|
204
|
+
"inker/enforce-import-name": [
|
|
205
|
+
2,
|
|
206
|
+
{
|
|
207
|
+
paths: [
|
|
208
|
+
{
|
|
209
|
+
name: "path",
|
|
210
|
+
|
|
211
|
+
importNames: [
|
|
212
|
+
{
|
|
213
|
+
imported: "namespace",
|
|
214
|
+
local: "Path",
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
imported: "default",
|
|
218
|
+
local: "Path",
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "date-fns",
|
|
224
|
+
|
|
225
|
+
importNames: [
|
|
226
|
+
{
|
|
227
|
+
imported: "format",
|
|
228
|
+
local: "formatDate",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
imported: "isValid",
|
|
232
|
+
local: "isDateValid",
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: "joi",
|
|
238
|
+
|
|
239
|
+
importNames: [
|
|
240
|
+
{
|
|
241
|
+
imported: "default",
|
|
242
|
+
local: "Joi",
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "lodash",
|
|
248
|
+
|
|
249
|
+
importNames: [
|
|
250
|
+
{
|
|
251
|
+
imported: "namespace",
|
|
252
|
+
local: "_",
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
imported: "default",
|
|
256
|
+
local: "_",
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
|
|
264
|
+
"inker/no-true-as-default": 2,
|
|
265
|
+
|
|
266
|
+
"import/order": [
|
|
267
|
+
2,
|
|
268
|
+
{
|
|
269
|
+
groups: [
|
|
270
|
+
"builtin",
|
|
271
|
+
"external",
|
|
272
|
+
"internal",
|
|
273
|
+
"parent",
|
|
274
|
+
"sibling",
|
|
275
|
+
"index",
|
|
276
|
+
],
|
|
277
|
+
"newlines-between": "always",
|
|
278
|
+
distinctGroup: false,
|
|
279
|
+
warnOnUnassignedImports: true,
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
|
|
283
|
+
"promise/no-new-statics": 2,
|
|
284
|
+
"promise/no-return-wrap": 2,
|
|
285
|
+
"promise/param-names": 2,
|
|
286
|
+
"promise/prefer-await-to-then": 2,
|
|
287
|
+
"promise/valid-params": 2,
|
|
288
|
+
"you-dont-need-lodash-underscore/concat": 2,
|
|
289
|
+
"you-dont-need-lodash-underscore/drop": 2,
|
|
290
|
+
"you-dont-need-lodash-underscore/drop-right": 2,
|
|
291
|
+
"you-dont-need-lodash-underscore/fill": 2,
|
|
292
|
+
"you-dont-need-lodash-underscore/find": 2,
|
|
293
|
+
"you-dont-need-lodash-underscore/find-index": 2,
|
|
294
|
+
"you-dont-need-lodash-underscore/index-of": 2,
|
|
295
|
+
"you-dont-need-lodash-underscore/is-array": 2,
|
|
296
|
+
"you-dont-need-lodash-underscore/join": 2,
|
|
297
|
+
"you-dont-need-lodash-underscore/last-index-of": 2,
|
|
298
|
+
"you-dont-need-lodash-underscore/slice": 2,
|
|
299
|
+
"you-dont-need-lodash-underscore/each": 2,
|
|
300
|
+
"you-dont-need-lodash-underscore/every": 2,
|
|
301
|
+
"you-dont-need-lodash-underscore/filter": 2,
|
|
302
|
+
"you-dont-need-lodash-underscore/includes": 2,
|
|
303
|
+
"you-dont-need-lodash-underscore/is-nil": 2,
|
|
304
|
+
"you-dont-need-lodash-underscore/map": 2,
|
|
305
|
+
"you-dont-need-lodash-underscore/reduce": 2,
|
|
306
|
+
"you-dont-need-lodash-underscore/reduce-right": 2,
|
|
307
|
+
"you-dont-need-lodash-underscore/size": 2,
|
|
308
|
+
"you-dont-need-lodash-underscore/some": 2,
|
|
309
|
+
"you-dont-need-lodash-underscore/bind": 2,
|
|
310
|
+
"you-dont-need-lodash-underscore/is-finite": 2,
|
|
311
|
+
"you-dont-need-lodash-underscore/is-integer": 2,
|
|
312
|
+
"you-dont-need-lodash-underscore/is-nan": 2,
|
|
313
|
+
"you-dont-need-lodash-underscore/assign": 2,
|
|
314
|
+
"you-dont-need-lodash-underscore/keys": 2,
|
|
315
|
+
"you-dont-need-lodash-underscore/to-pairs": 2,
|
|
316
|
+
"you-dont-need-lodash-underscore/values": 2,
|
|
317
|
+
"you-dont-need-lodash-underscore/ends-with": 2,
|
|
318
|
+
"you-dont-need-lodash-underscore/pad-start": 2,
|
|
319
|
+
"you-dont-need-lodash-underscore/pad-end": 2,
|
|
320
|
+
"you-dont-need-lodash-underscore/repeat": 2,
|
|
321
|
+
"you-dont-need-lodash-underscore/replace": 2,
|
|
322
|
+
"you-dont-need-lodash-underscore/split": 2,
|
|
323
|
+
"you-dont-need-lodash-underscore/starts-with": 2,
|
|
324
|
+
"eslint-comments/no-unused-disable": 2,
|
|
325
|
+
|
|
326
|
+
"eslint-comments/no-use": [
|
|
327
|
+
2,
|
|
328
|
+
{
|
|
329
|
+
allow: ["eslint-disable", "eslint-disable-next-line"],
|
|
330
|
+
},
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mimica/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Mimica eslint config",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"eslint-plugin-import": "^2.26.0",
|
|
31
31
|
"eslint-plugin-inker": "^2.2.2",
|
|
32
32
|
"eslint-plugin-promise": "^7.1.0",
|
|
33
|
-
"eslint-plugin-sonarjs": "^
|
|
33
|
+
"eslint-plugin-sonarjs": "^3.0.1",
|
|
34
34
|
"eslint-plugin-unicorn": "^56.0.0",
|
|
35
35
|
"eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0"
|
|
36
36
|
},
|