@mimica/eslint-config 1.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.
Files changed (2) hide show
  1. package/index.js +298 -0
  2. package/package.json +44 -0
package/index.js ADDED
@@ -0,0 +1,298 @@
1
+ module.exports = {
2
+ extends: ["airbnb-base", "plugin:unicorn/recommended"],
3
+ env: {
4
+ es6: true,
5
+ },
6
+ plugins: [
7
+ "sonarjs",
8
+ "unicorn",
9
+ "inker",
10
+ "promise",
11
+ "you-dont-need-lodash-underscore",
12
+ "eslint-comments",
13
+ ],
14
+ parser: "@babel/eslint-parser",
15
+ parserOptions: {
16
+ requireConfigFile: false,
17
+ },
18
+ rules: {
19
+ "arrow-parens": 0, // TODO: do not disable "arrow-parens" rule
20
+ camelcase: [
21
+ 1,
22
+ {
23
+ allow: [],
24
+ },
25
+ ],
26
+ "consistent-return": 0,
27
+ curly: [2, "all"],
28
+ "function-paren-newline": [0, "never"],
29
+ "guard-for-in": 1,
30
+ "implicit-arrow-linebreak": 0,
31
+ indent: 0,
32
+ "lines-between-class-members": [
33
+ 2,
34
+ "always",
35
+ {
36
+ exceptAfterSingleLine: true,
37
+ },
38
+ ],
39
+ "max-params": [2, 4],
40
+ "no-confusing-arrow": 0,
41
+ "no-console": 2,
42
+ "no-continue": 0,
43
+ "no-loop-func": 1,
44
+ "no-param-reassign": [
45
+ 2,
46
+ {
47
+ props: false,
48
+ },
49
+ ],
50
+ "no-plusplus": 0,
51
+ "no-restricted-syntax": [
52
+ 2,
53
+ "ForInStatement",
54
+ "LabeledStatement",
55
+ "WithStatement",
56
+ {
57
+ selector:
58
+ ':matches(PropertyDefinition, MethodDefinition)[accessibility="private"]',
59
+ message: "Use #private instead.",
60
+ },
61
+ ],
62
+ "no-underscore-dangle": 0,
63
+ "no-unused-vars": [2, { args: "none" }],
64
+ "no-useless-escape": 2,
65
+ "object-curly-newline": 0,
66
+ "operator-linebreak": 0,
67
+ "padding-line-between-statements": [
68
+ 2,
69
+ {
70
+ blankLine: "always",
71
+ prev: "*",
72
+ next: "function",
73
+ },
74
+ {
75
+ blankLine: "always",
76
+ prev: "function",
77
+ next: "*",
78
+ },
79
+ {
80
+ blankLine: "always",
81
+ prev: "*",
82
+ next: "class",
83
+ },
84
+ {
85
+ blankLine: "always",
86
+ prev: "class",
87
+ next: "*",
88
+ },
89
+ {
90
+ blankLine: "always",
91
+ prev: "cjs-export",
92
+ next: "*",
93
+ },
94
+ {
95
+ blankLine: "always",
96
+ prev: "*",
97
+ next: "cjs-export",
98
+ },
99
+ ],
100
+ "prefer-destructuring": [
101
+ 2,
102
+ {
103
+ array: false,
104
+ object: true,
105
+ },
106
+ ],
107
+ quotes: [0, "double"],
108
+ semi: [2, "always"],
109
+
110
+ "sonarjs/no-inverted-boolean-check": 2,
111
+ "sonarjs/prefer-immediate-return": 2,
112
+ "sonarjs/prefer-while": 2,
113
+
114
+ "unicorn/catch-error-name": [
115
+ 2,
116
+ {
117
+ name: "err",
118
+ ignore: ["error"],
119
+ },
120
+ ],
121
+ "unicorn/consistent-function-scoping": 0,
122
+ "unicorn/custom-error-definition": 2,
123
+ "unicorn/empty-brace-spaces": 0,
124
+ "unicorn/explicit-length-check": 0,
125
+ "unicorn/filename-case": 0,
126
+ "unicorn/import-style": 0,
127
+ "unicorn/no-array-callback-reference": 0,
128
+ "unicorn/no-array-reduce": [
129
+ 2,
130
+ {
131
+ allowSimpleOperations: false,
132
+ },
133
+ ],
134
+ "unicorn/no-nested-ternary": 0,
135
+ "unicorn/no-null": 0,
136
+ "unicorn/no-process-exit": 0,
137
+ "unicorn/no-useless-undefined": 0, // TODO: enable
138
+ "unicorn/numeric-separators-style": 0,
139
+ "unicorn/prefer-add-event-listener": 0, // TODO: enable
140
+ "unicorn/prefer-module": 0,
141
+ "unicorn/prefer-node-protocol": 0, // TODO: enable
142
+ "unicorn/prefer-query-selector": 0,
143
+ "unicorn/prefer-set-has": 0, // TODO: enable
144
+ "unicorn/prefer-spread": 0, // TODO: enable
145
+ "unicorn/prefer-switch": 0,
146
+ "unicorn/prefer-ternary": 0, // TODO: enable
147
+ "unicorn/prefer-top-level-await": 0,
148
+ "unicorn/prevent-abbreviations": 0,
149
+ "unicorn/switch-case-braces": 0,
150
+ // "unicorn/template-indent": [
151
+ // 2,
152
+ // {
153
+ // selectors: ["TemplateLiteral"],
154
+ // comments: ["sql"],
155
+ // },
156
+ // ],
157
+
158
+ "inker/enforce-import-name": [
159
+ 2,
160
+ {
161
+ paths: [
162
+ {
163
+ name: "path",
164
+ importNames: [
165
+ {
166
+ imported: "namespace",
167
+ local: "Path",
168
+ },
169
+ {
170
+ imported: "default",
171
+ local: "Path",
172
+ },
173
+ ],
174
+ },
175
+ {
176
+ name: "date-fns",
177
+ importNames: [
178
+ {
179
+ imported: "format",
180
+ local: "formatDate",
181
+ },
182
+ {
183
+ imported: "isValid",
184
+ local: "isDateValid",
185
+ },
186
+ ],
187
+ },
188
+ {
189
+ name: "joi",
190
+ importNames: [
191
+ {
192
+ imported: "default",
193
+ local: "Joi",
194
+ },
195
+ ],
196
+ },
197
+ {
198
+ name: "lodash",
199
+ importNames: [
200
+ {
201
+ imported: "namespace",
202
+ local: "_",
203
+ },
204
+ {
205
+ imported: "default",
206
+ local: "_",
207
+ },
208
+ ],
209
+ },
210
+ {
211
+ name: "uuid",
212
+ importNames: [
213
+ {
214
+ imported: "v4",
215
+ local: "uuidv4",
216
+ },
217
+ ],
218
+ },
219
+ ],
220
+ },
221
+ ],
222
+ "inker/no-true-as-default": 2,
223
+
224
+ "import/order": [
225
+ 2,
226
+ {
227
+ groups: [
228
+ "builtin",
229
+ "external",
230
+ "internal",
231
+ "parent",
232
+ "sibling",
233
+ "index",
234
+ ],
235
+ "newlines-between": "always-and-inside-groups",
236
+ distinctGroup: false,
237
+ warnOnUnassignedImports: true,
238
+ },
239
+ ],
240
+
241
+ // "promise/catch-or-return": 2,
242
+ "promise/no-new-statics": 2,
243
+ "promise/no-return-wrap": 2,
244
+ "promise/param-names": 2,
245
+ "promise/prefer-await-to-then": 2,
246
+ "promise/valid-params": 2,
247
+
248
+ "you-dont-need-lodash-underscore/concat": 2,
249
+ "you-dont-need-lodash-underscore/drop": 2,
250
+ "you-dont-need-lodash-underscore/drop-right": 2,
251
+ "you-dont-need-lodash-underscore/fill": 2,
252
+ "you-dont-need-lodash-underscore/find": 2,
253
+ "you-dont-need-lodash-underscore/find-index": 2,
254
+ // "you-dont-need-lodash-underscore/from-pairs": 2,
255
+ "you-dont-need-lodash-underscore/index-of": 2,
256
+ "you-dont-need-lodash-underscore/is-array": 2,
257
+ // "you-dont-need-lodash-underscore/is-array-buffer": 2,
258
+ "you-dont-need-lodash-underscore/join": 2,
259
+ "you-dont-need-lodash-underscore/last-index-of": 2,
260
+ "you-dont-need-lodash-underscore/slice": 2,
261
+ "you-dont-need-lodash-underscore/each": 2,
262
+ "you-dont-need-lodash-underscore/every": 2,
263
+ "you-dont-need-lodash-underscore/filter": 2,
264
+ "you-dont-need-lodash-underscore/includes": 2,
265
+ "you-dont-need-lodash-underscore/map": 2,
266
+ // "you-dont-need-lodash-underscore/pluck": 2,
267
+ "you-dont-need-lodash-underscore/reduce": 2,
268
+ "you-dont-need-lodash-underscore/reduce-right": 2,
269
+ "you-dont-need-lodash-underscore/size": 2,
270
+ "you-dont-need-lodash-underscore/some": 2,
271
+ "you-dont-need-lodash-underscore/bind": 2,
272
+ // "you-dont-need-lodash-underscore/partial": 2,
273
+ "you-dont-need-lodash-underscore/is-finite": 2,
274
+ "you-dont-need-lodash-underscore/is-integer": 2,
275
+ "you-dont-need-lodash-underscore/is-nan": 2,
276
+ "you-dont-need-lodash-underscore/assign": 2,
277
+ // "you-dont-need-lodash-underscore/extend": 2,
278
+ "you-dont-need-lodash-underscore/keys": 2,
279
+ "you-dont-need-lodash-underscore/to-pairs": 2,
280
+ "you-dont-need-lodash-underscore/values": 2,
281
+ "you-dont-need-lodash-underscore/ends-with": 2,
282
+ "you-dont-need-lodash-underscore/pad-start": 2,
283
+ "you-dont-need-lodash-underscore/pad-end": 2,
284
+ "you-dont-need-lodash-underscore/repeat": 2,
285
+ "you-dont-need-lodash-underscore/replace": 2,
286
+ "you-dont-need-lodash-underscore/split": 2,
287
+ "you-dont-need-lodash-underscore/starts-with": 2,
288
+ // "you-dont-need-lodash-underscore/template": 2,
289
+
290
+ "eslint-comments/no-unused-disable": 2,
291
+ "eslint-comments/no-use": [
292
+ 2,
293
+ {
294
+ allow: ["eslint-disable", "eslint-disable-next-line"],
295
+ },
296
+ ],
297
+ },
298
+ };
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@mimica/eslint-config",
3
+ "version": "1.0.0",
4
+ "description": "Mimica eslint config",
5
+ "main": "index.js",
6
+ "engines": {
7
+ "node": "^18.14.2",
8
+ "npm": "^9.5.0"
9
+ },
10
+ "scripts": {
11
+ "test": "exit 0",
12
+ "prepublishOnly": "npm run lint-prettier",
13
+ "lint-prettier": "prettier --cache --check \"**/*.{css,js,mjs,jsx,ts,tsx,json,scss}\"",
14
+ "lint-prettier-fix": "prettier --cache --write \"**/*.{css,js,mjs,jsx,ts,tsx,json,scss}\""
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/mimica/eslint-config.git"
19
+ },
20
+ "keywords": [
21
+ "eslint",
22
+ "config"
23
+ ],
24
+ "author": "Anton Veselev",
25
+ "license": "ISC",
26
+ "bugs": {
27
+ "url": "https://github.com/mimica/eslint-config/issues"
28
+ },
29
+ "homepage": "https://github.com/mimica/eslint-config#readme",
30
+ "dependencies": {
31
+ "@babel/eslint-parser": "^7.18.9",
32
+ "eslint-config-airbnb-base": "^15.0.0",
33
+ "eslint-plugin-eslint-comments": "^3.2.0",
34
+ "eslint-plugin-import": "^2.26.0",
35
+ "eslint-plugin-inker": "^2.2.2",
36
+ "eslint-plugin-promise": "^6.0.0",
37
+ "eslint-plugin-sonarjs": "^0.23.0",
38
+ "eslint-plugin-unicorn": "^49.0.0",
39
+ "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0"
40
+ },
41
+ "devDependencies": {
42
+ "prettier": "^3.0.3"
43
+ }
44
+ }