@w5s/eslint-config 1.0.0-alpha.1

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/rules/base.js ADDED
@@ -0,0 +1,464 @@
1
+ const { off, warn, error } = require('./_rule');
2
+
3
+ module.exports = {
4
+ env: {
5
+ es6: true,
6
+ },
7
+ extends: [require.resolve('./node')], // TODO: remove that extends and provide a standalone configuration
8
+ plugins: [],
9
+ rules: {
10
+ 'accessor-pairs': error,
11
+ 'array-bracket-newline': off,
12
+ 'array-bracket-spacing': [error, 'never'],
13
+ 'array-callback-return': error,
14
+ 'array-element-newline': off,
15
+ 'arrow-body-style': [error, 'always'],
16
+ 'arrow-parens': [error, 'always'],
17
+ 'arrow-spacing': [error, { after: true, before: true }],
18
+ 'block-scoped-var': error,
19
+ 'block-spacing': [error, 'always'],
20
+ 'brace-style': [error, '1tbs', { allowSingleLine: false }],
21
+ camelcase: off,
22
+ 'capitalized-comments': off,
23
+ 'class-methods-use-this': off,
24
+ 'comma-dangle': [error, 'always-multiline'],
25
+ 'comma-spacing': [error, { after: true, before: false }],
26
+ 'comma-style': [error, 'last'],
27
+ complexity: [error, 20],
28
+ 'computed-property-spacing': [error, 'never'],
29
+ 'consistent-return': error,
30
+ 'consistent-this': [error, 'self'],
31
+ 'constructor-super': error,
32
+ curly: error,
33
+ 'default-case': [error, { commentPattern: '^no default$' }], // require default case in switch statements or ignore by adding `//no default`
34
+ 'dot-location': [error, 'property'],
35
+ 'dot-notation': error,
36
+ 'eol-last': error,
37
+ eqeqeq: [error, 'smart'],
38
+ 'for-direction': error,
39
+ 'func-call-spacing': [error, 'never'],
40
+ 'func-name-matching': error,
41
+ 'func-names': off,
42
+ 'func-style': off,
43
+ 'function-paren-newline': [error, 'consistent'],
44
+ 'generator-star-spacing': [error, { after: false, before: true }],
45
+ 'getter-return': [error, { allowImplicit: true }],
46
+ 'guard-for-in': error,
47
+ 'id-length': [error, { exceptions: ['t', '$', '_', 'x', 'y', 'z'], max: 50, min: 2, properties: 'never' }],
48
+ 'id-match': off,
49
+ 'implicit-arrow-linebreak': [error, 'beside'],
50
+ indent: [error, 2],
51
+ 'init-declarations': off,
52
+ 'jsx-quotes': [error, 'prefer-double'],
53
+ 'key-spacing': [
54
+ error,
55
+ {
56
+ afterColon: true,
57
+ beforeColon: false,
58
+ },
59
+ ],
60
+ 'keyword-spacing': [
61
+ error,
62
+ {
63
+ after: true,
64
+ before: true,
65
+ },
66
+ ],
67
+ 'line-comment-position': 0,
68
+ 'linebreak-style': [error, 'unix'],
69
+ 'lines-around-comment': [
70
+ error,
71
+ {
72
+ allowArrayEnd: true,
73
+ allowArrayStart: true,
74
+ allowBlockEnd: true,
75
+ allowBlockStart: true,
76
+ allowObjectEnd: true,
77
+ allowObjectStart: true,
78
+ beforeBlockComment: true,
79
+ beforeLineComment: true,
80
+ },
81
+ ],
82
+ 'lines-around-directive': [error, 'always'],
83
+ 'lines-between-class-members': [error, 'always', { exceptAfterSingleLine: true }],
84
+ 'max-len': [
85
+ warn,
86
+ {
87
+ code: 160,
88
+ },
89
+ ],
90
+ 'max-nested-callbacks': [warn, { max: 5 }],
91
+ 'max-statements-per-line': [
92
+ error,
93
+ {
94
+ max: 1,
95
+ },
96
+ ],
97
+ 'multiline-comment-style': off,
98
+ 'multiline-ternary': off,
99
+ 'new-cap': [
100
+ off,
101
+ {
102
+ capIsNew: false,
103
+ newIsCap: true,
104
+ },
105
+ ],
106
+ 'new-parens': error,
107
+ 'newline-after-var': off,
108
+ 'newline-before-return': error,
109
+ 'newline-per-chained-call': off,
110
+ 'no-alert': error,
111
+ 'no-array-constructor': error,
112
+ 'no-async-promise-executor': error,
113
+ 'no-await-in-loop': error,
114
+ 'no-caller': error,
115
+ 'no-case-declarations': error,
116
+ 'no-catch-shadow': error,
117
+ 'no-class-assign': error,
118
+ 'no-compare-neg-zero': error,
119
+ 'no-cond-assign': error,
120
+ 'no-confusing-arrow': error,
121
+ 'no-console': error,
122
+ 'no-const-assign': error,
123
+ 'no-constant-condition': warn,
124
+ 'no-continue': off,
125
+ 'no-control-regex': error,
126
+ 'no-debugger': error,
127
+ 'no-delete-var': error,
128
+ 'no-div-regex': error,
129
+ 'no-dupe-args': error,
130
+ 'no-dupe-class-members': error,
131
+ 'no-dupe-else-if': error,
132
+ 'no-dupe-keys': error,
133
+ 'no-duplicate-case': error,
134
+ 'no-duplicate-imports': off,
135
+ 'no-else-return': [error, { allowElseIf: false }],
136
+ 'no-empty': error,
137
+ 'no-empty-character-class': error,
138
+ 'no-empty-function': [error, { allow: ['arrowFunctions', 'functions', 'methods'] }],
139
+ 'no-empty-pattern': error,
140
+ 'no-eq-null': off,
141
+ 'no-eval': error,
142
+ 'no-ex-assign': error,
143
+ 'no-extend-native': error,
144
+ 'no-extra-bind': error,
145
+ 'no-extra-boolean-cast': error,
146
+ 'no-extra-parens': error,
147
+ 'no-extra-semi': error,
148
+ 'no-fallthrough': error,
149
+ 'no-floating-decimal': error,
150
+ 'no-func-assign': error,
151
+ 'no-global-assign': error,
152
+ 'no-implicit-coercion': error,
153
+ 'no-implicit-globals': off,
154
+ 'no-implied-eval': error,
155
+ 'no-import-assign': error,
156
+ 'no-inline-comments': off,
157
+ 'no-inner-declarations': error,
158
+ 'no-invalid-regexp': error,
159
+ 'no-invalid-this': off,
160
+ 'no-irregular-whitespace': error,
161
+ 'no-iterator': error,
162
+ 'no-label-var': error,
163
+ 'no-labels': error,
164
+ 'no-lone-blocks': error,
165
+ 'no-lonely-if': error,
166
+ 'no-loop-func': error,
167
+ 'no-loss-of-precision': error,
168
+ 'no-magic-numbers': off,
169
+ 'no-misleading-character-class': error,
170
+ 'no-mixed-spaces-and-tabs': error,
171
+ 'no-multi-spaces': [
172
+ error,
173
+ {
174
+ ignoreEOLComments: false,
175
+ },
176
+ ],
177
+ 'no-multi-str': error,
178
+ 'no-multiple-empty-lines': [
179
+ error,
180
+ {
181
+ max: 1,
182
+ maxBOF: 0,
183
+ maxEOF: 1,
184
+ },
185
+ ],
186
+ 'no-native-reassign': error,
187
+ 'no-negated-condition': off,
188
+ 'no-negated-in-lhs': error,
189
+ 'no-nested-ternary': off,
190
+ 'no-new': error,
191
+ 'no-new-func': error,
192
+ 'no-new-object': error,
193
+ 'no-new-require': error,
194
+ 'no-new-symbol': error,
195
+ 'no-new-wrappers': error,
196
+ 'no-obj-calls': error,
197
+ 'no-octal': error,
198
+ 'no-octal-escape': error,
199
+ 'no-param-reassign': [
200
+ error,
201
+ {
202
+ props: false,
203
+ },
204
+ ],
205
+ 'no-plusplus': error,
206
+ 'no-promise-executor-return': error,
207
+ 'no-proto': error,
208
+ 'no-prototype-builtins': error,
209
+ 'no-redeclare': [
210
+ error,
211
+ {
212
+ builtinGlobals: true,
213
+ },
214
+ ],
215
+ 'no-regex-spaces': error,
216
+ 'no-restricted-globals': off,
217
+ 'no-restricted-properties': [
218
+ error,
219
+ {
220
+ message: 'arguments.callee is deprecated',
221
+ object: 'arguments',
222
+ property: 'callee',
223
+ },
224
+ {
225
+ message: 'Please use Number.isFinite instead',
226
+ object: 'global',
227
+ property: 'isFinite',
228
+ },
229
+ {
230
+ message: 'Please use Number.isFinite instead',
231
+ object: 'self',
232
+ property: 'isFinite',
233
+ },
234
+ {
235
+ message: 'Please use Number.isFinite instead',
236
+ object: 'window',
237
+ property: 'isFinite',
238
+ },
239
+ {
240
+ message: 'Please use Number.isNaN instead',
241
+ object: 'global',
242
+ property: 'isNaN',
243
+ },
244
+ {
245
+ message: 'Please use Number.isNaN instead',
246
+ object: 'self',
247
+ property: 'isNaN',
248
+ },
249
+ {
250
+ message: 'Please use Number.isNaN instead',
251
+ object: 'window',
252
+ property: 'isNaN',
253
+ },
254
+ {
255
+ message: 'Please use Object.defineProperty instead.',
256
+ property: '__defineGetter__',
257
+ },
258
+ {
259
+ message: 'Please use Object.defineProperty instead.',
260
+ property: '__defineSetter__',
261
+ },
262
+ {
263
+ message: 'Use the exponentiation operator (**) instead.',
264
+ object: 'Math',
265
+ property: 'pow',
266
+ },
267
+ ],
268
+ 'no-restricted-syntax': [
269
+ error,
270
+ {
271
+ message:
272
+ 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
273
+ selector: 'ForInStatement',
274
+ },
275
+ {
276
+ message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
277
+ selector: 'LabeledStatement',
278
+ },
279
+ {
280
+ message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
281
+ selector: 'WithStatement',
282
+ },
283
+ ],
284
+ 'no-return-assign': error,
285
+ 'no-return-await': error,
286
+ 'no-script-url': error,
287
+ 'no-self-assign': error,
288
+ 'no-self-compare': error,
289
+ 'no-sequences': error,
290
+ 'no-setter-return': error,
291
+ 'no-shadow': [
292
+ error,
293
+ {
294
+ builtinGlobals: false,
295
+ hoist: 'all',
296
+ },
297
+ ],
298
+ 'no-shadow-restricted-names': error,
299
+ 'no-spaced-func': error,
300
+ 'no-sparse-arrays': error,
301
+ 'no-sync': off,
302
+ 'no-tabs': error,
303
+ 'no-template-curly-in-string': error,
304
+ 'no-ternary': off,
305
+ 'no-this-before-super': error,
306
+ 'no-throw-literal': error,
307
+ 'no-trailing-spaces': error,
308
+ 'no-undef': error,
309
+ 'no-undef-init': error,
310
+ 'no-undefined': off,
311
+ 'no-underscore-dangle': off,
312
+ 'no-unexpected-multiline': error,
313
+ 'no-unmodified-loop-condition': error,
314
+ 'no-unneeded-ternary': off, // error,
315
+ 'no-unreachable': error,
316
+ 'no-unreachable-loop': error,
317
+ 'no-unsafe-finally': error,
318
+ 'no-unsafe-negation': error,
319
+ 'no-unsafe-optional-chaining': [error, { disallowArithmeticOperators: true }],
320
+ 'no-unused-expressions': [
321
+ error,
322
+ {
323
+ allowShortCircuit: false,
324
+ allowTaggedTemplates: true,
325
+ allowTernary: false,
326
+ },
327
+ ],
328
+ 'no-unused-vars': [
329
+ error,
330
+ {
331
+ args: 'none',
332
+ ignoreRestSiblings: true,
333
+ vars: 'all',
334
+ },
335
+ ],
336
+ 'no-use-before-define': [
337
+ error,
338
+ {
339
+ classes: false,
340
+ functions: false,
341
+ variables: false,
342
+ },
343
+ ],
344
+ 'no-useless-backreference': error,
345
+ 'no-useless-call': error,
346
+ 'no-useless-catch': error,
347
+ 'no-useless-computed-key': error,
348
+ 'no-useless-concat': error,
349
+ 'no-useless-constructor': error,
350
+ 'no-useless-escape': error,
351
+ 'no-useless-rename': [
352
+ error,
353
+ {
354
+ ignoreDestructuring: false,
355
+ ignoreExport: false,
356
+ ignoreImport: false,
357
+ },
358
+ ],
359
+ 'no-useless-return': error,
360
+ 'no-var': error,
361
+ 'no-void': error,
362
+ 'no-warning-comments': [
363
+ off,
364
+ {
365
+ location: 'start',
366
+ terms: ['todo', '@todo'],
367
+ },
368
+ ],
369
+ 'no-whitespace-before-property': error,
370
+ 'no-with': error,
371
+ 'nonblock-statement-body-position': [error, 'below'],
372
+ 'object-curly-spacing': [off, 'never'],
373
+ 'object-property-newline': [
374
+ error,
375
+ {
376
+ allowMultiplePropertiesPerLine: false,
377
+ },
378
+ ],
379
+ 'object-shorthand': [error, 'always'],
380
+ 'one-var': [error, 'never'],
381
+ 'one-var-declaration-per-line': error,
382
+ 'operator-assignment': [error, 'always'],
383
+ 'operator-linebreak': [error, 'after'],
384
+ 'padded-blocks': [error, 'never'],
385
+ 'padding-line-between-statements': off,
386
+ 'prefer-arrow-callback': error,
387
+ 'prefer-const': error,
388
+ 'prefer-destructuring': off,
389
+ 'prefer-named-capture-group': off,
390
+ 'prefer-numeric-literals': error,
391
+ 'prefer-promise-reject-errors': error,
392
+ 'prefer-reflect': off,
393
+ 'prefer-rest-params': error,
394
+ 'prefer-spread': error,
395
+ 'prefer-template': error,
396
+ 'quote-props': [error, 'as-needed'],
397
+ quotes: [error, 'single'],
398
+ radix: error,
399
+ 'require-await': off, // https://github.com/airbnb/javascript/issues/2013
400
+ 'require-jsdoc': off,
401
+ 'require-yield': error,
402
+ semi: [error, 'always'],
403
+ 'semi-spacing': [
404
+ error,
405
+ {
406
+ after: true,
407
+ before: false,
408
+ },
409
+ ],
410
+ 'semi-style': [error, 'last'],
411
+ 'sort-keys': off /* [
412
+ error,
413
+ 'asc',
414
+ {
415
+ caseSensitive: false,
416
+ natural: true
417
+ }
418
+ ], */,
419
+ 'sort-vars': error,
420
+ 'space-before-blocks': [error, 'always'],
421
+ 'space-before-function-paren': [error, 'always'],
422
+ 'space-in-parens': [error, 'never'],
423
+ 'space-infix-ops': error,
424
+ 'space-unary-ops': [
425
+ error,
426
+ {
427
+ nonwords: false,
428
+ words: true,
429
+ },
430
+ ],
431
+ 'spaced-comment': [
432
+ error,
433
+ 'always',
434
+ {
435
+ block: {
436
+ balanced: true,
437
+ exceptions: ['*'],
438
+ markers: ['*package', '!', ',', ':', '::', 'flow-include'],
439
+ },
440
+ line: {
441
+ markers: ['*package', '!', '/', ',', '='],
442
+ },
443
+ },
444
+ ],
445
+ strict: [error, 'never'],
446
+ 'switch-colon-spacing': [
447
+ error,
448
+ {
449
+ after: true,
450
+ before: false,
451
+ },
452
+ ],
453
+ 'symbol-description': error,
454
+ 'template-tag-spacing': [error, 'never'],
455
+ 'unicode-bom': [error, 'never'],
456
+ 'use-isnan': error,
457
+ 'valid-jsdoc': off,
458
+ 'valid-typeof': [error, { requireStringLiterals: true }],
459
+ 'vars-on-top': error,
460
+ 'wrap-iife': [error, 'inside'],
461
+ 'wrap-regex': off,
462
+ yoda: off,
463
+ },
464
+ };
@@ -0,0 +1,118 @@
1
+ const { off, warn, error } = require('./_rule');
2
+
3
+ /**
4
+ * @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
5
+ * @param {string} _status
6
+ */
7
+ // eslint-disable-next-line no-unused-vars
8
+ const performanceIssue = (_status) => {
9
+ return off;
10
+ };
11
+
12
+ module.exports = {
13
+ plugins: ['import'],
14
+ rules: {
15
+ 'import/default': error,
16
+ 'import/export': error,
17
+ 'import/exports-last': off,
18
+ 'import/extensions': [
19
+ error,
20
+ 'ignorePackages',
21
+ {
22
+ js: 'never',
23
+ json: 'always',
24
+ jsx: 'never',
25
+ mjs: 'never',
26
+ ts: 'never',
27
+ tsx: 'never',
28
+ },
29
+ ],
30
+ 'import/first': [error, 'absolute-first'],
31
+ 'import/group-exports': off,
32
+ 'import/max-dependencies': [
33
+ off,
34
+ {
35
+ max: 10,
36
+ },
37
+ ],
38
+ 'import/named': error,
39
+ 'import/namespace': error,
40
+ 'import/newline-after-import': error,
41
+ 'import/no-absolute-path': error,
42
+ 'import/no-amd': error,
43
+ 'import/no-anonymous-default-export': off,
44
+ 'import/no-commonjs': off, // Still used widely by nodejs programs
45
+ 'import/no-cycle': [error, { maxDepth: Number.POSITIVE_INFINITY }], // Elm, ReasonML forbids circular dependency
46
+ 'import/no-default-export': off,
47
+ 'import/no-deprecated': performanceIssue(warn),
48
+ 'import/no-duplicates': error,
49
+ 'import/no-dynamic-require': error,
50
+ 'import/no-extraneous-dependencies': [
51
+ error,
52
+ {
53
+ // https://github.com/airbnb/javascript/blob/1eadb93e377da1e56c3f91f26610e5d0a00738a9/packages/eslint-config-airbnb-base/rules/imports.js#L71
54
+ devDependencies: [
55
+ 'test/**', // tape, common npm pattern
56
+ 'tests/**', // also common npm pattern
57
+ 'spec/**', // mocha, rspec-like pattern
58
+ '**/__tests__/**', // jest pattern
59
+ '**/__mocks__/**', // jest pattern
60
+ 'test.{js,jsx,ts,tsx}', // repos with a single test file
61
+ 'test-*.{js,jsx,ts,tsx}', // repos with multiple top-level test files
62
+ '**/*{.,_}{test,spec}.{js,jsx,ts,tsx}', // tests where the extension or filename suffix denotes that it is a test
63
+ '**/jest.config.{js,ts}', // jest config
64
+ '**/jest.setup.{js,ts}', // jest setup
65
+ '**/vue.config.{js,ts}', // vue-cli config
66
+ '**/webpack.config.js', // webpack config
67
+ '**/webpack.config.*.js', // webpack config
68
+ '**/rollup.config.js', // rollup config
69
+ '**/rollup.config.*.js', // rollup config
70
+ '**/gulpfile.js', // gulp config
71
+ '**/gulpfile.*.js', // gulp config
72
+ '**/Gruntfile{,.js}', // grunt config
73
+ '**/protractor.conf.js', // protractor config
74
+ '**/protractor.conf.*.js', // protractor config
75
+ '**/karma.conf.js', // karma config
76
+ '**/.eslintrc.js', // eslint config,
77
+ '**/markdown.config.js', // markdown magic config,
78
+ ],
79
+ optionalDependencies: false,
80
+ },
81
+ ],
82
+ 'import/no-internal-modules': off,
83
+ 'import/no-mutable-exports': error,
84
+ 'import/no-named-as-default': performanceIssue(error),
85
+ 'import/no-named-as-default-member': error,
86
+ 'import/no-named-default': error,
87
+ 'import/no-named-export': off,
88
+ 'import/no-namespace': off,
89
+ 'import/no-nodejs-modules': off,
90
+ 'import/no-relative-parent-imports': off,
91
+ 'import/no-restricted-paths': off,
92
+ 'import/no-self-import': error,
93
+ 'import/no-unassigned-import': off,
94
+ 'import/no-unresolved': [error, { caseSensitive: true, commonjs: true }],
95
+ 'import/no-unused-modules': [performanceIssue(error), { unusedExports: true }],
96
+ 'import/no-useless-path-segments': error,
97
+ 'import/no-webpack-loader-syntax': error,
98
+ 'import/order': [
99
+ error,
100
+ {
101
+ groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
102
+ 'newlines-between': 'never',
103
+ },
104
+ ],
105
+ 'import/prefer-default-export': off,
106
+ 'import/unambiguous': off, // Disable because proposal still in progress
107
+ },
108
+ settings: {
109
+ 'import/core-modules': [],
110
+ 'import/extensions': ['.js', '.mjs', '.jsx'],
111
+ 'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$'],
112
+ 'import/resolver': {
113
+ node: {
114
+ extensions: ['.mjs', '.js', '.json'],
115
+ },
116
+ },
117
+ },
118
+ };
package/rules/jest.js ADDED
@@ -0,0 +1,46 @@
1
+ const { off, error } = require('./_rule');
2
+
3
+ /**
4
+ * Typescript config is loose because we often have "hack", "mock" in tests
5
+ */
6
+ const tsDisabled = {
7
+ '@typescript-eslint/no-unsafe-assignment': off,
8
+ '@typescript-eslint/no-unsafe-call': off,
9
+ '@typescript-eslint/no-unsafe-member-access': off,
10
+ '@typescript-eslint/no-unsafe-return': off,
11
+ '@typescript-eslint/restrict-template-expressions': off,
12
+ '@typescript-eslint/unbound-method': off,
13
+ };
14
+
15
+ module.exports = {
16
+ env: {
17
+ jest: true,
18
+ },
19
+ extends: ['plugin:jest/recommended'],
20
+ plugins: ['jest'],
21
+ rules: Object.assign(
22
+ {
23
+ 'jest/expect-expect': off, // Disabled because it does not handle functions that does the expect
24
+ 'jest/no-alias-methods': error,
25
+ 'jest/no-commented-out-tests': error,
26
+ 'jest/no-deprecated-functions': off,
27
+ 'jest/no-disabled-tests': off,
28
+ 'jest/no-done-callback': error,
29
+ 'jest/no-export': off,
30
+ 'jest/no-focused-tests': error,
31
+ 'jest/no-identical-title': error,
32
+ 'jest/no-restricted-matchers': [
33
+ error,
34
+ {
35
+ toBeFalsy: 'Avoid `toBeFalsy`',
36
+ toBeTruthy: 'Avoid `toBeTruthy`',
37
+ },
38
+ ],
39
+ 'jest/prefer-spy-on': error,
40
+ 'jest/prefer-to-contain': error,
41
+ 'jest/valid-expect': error,
42
+ 'jest/valid-title': [error, { ignoreTypeOfDescribeName: true }],
43
+ },
44
+ tsDisabled
45
+ ),
46
+ };
package/rules/jsdoc.js ADDED
@@ -0,0 +1,20 @@
1
+ const { off, warn, error } = require('./_rule');
2
+
3
+ module.exports = {
4
+ plugins: ['jsdoc'],
5
+ rules: {
6
+ 'jsdoc/check-param-names': warn,
7
+ 'jsdoc/check-tag-names': warn,
8
+ 'jsdoc/check-types': warn,
9
+ 'jsdoc/newline-after-description': [warn, 'always'],
10
+ 'jsdoc/require-description': off,
11
+ 'jsdoc/require-description-complete-sentence': off,
12
+ 'jsdoc/require-hyphen-before-param-description': off,
13
+ 'jsdoc/require-param': off,
14
+ 'jsdoc/require-param-description': off,
15
+ 'jsdoc/require-param-name': error,
16
+ 'jsdoc/require-param-type': off,
17
+ 'jsdoc/require-returns-description': off,
18
+ 'jsdoc/require-returns-type': off,
19
+ },
20
+ };
package/rules/node.js ADDED
@@ -0,0 +1,21 @@
1
+ const { off, error } = require('./_rule');
2
+
3
+ // @see https://eslint.org/blog/2020/02/whats-coming-in-eslint-7.0.0#deprecating-node-js-commonjs-specific-rules
4
+ module.exports = {
5
+ env: {
6
+ node: true,
7
+ },
8
+ rules: {
9
+ 'callback-return': off,
10
+ 'global-require': error,
11
+ 'handle-callback-err': off,
12
+ 'no-buffer-constructor': error,
13
+ 'no-mixed-requires': [off, false],
14
+ 'no-new-require': error,
15
+ 'no-path-concat': error,
16
+ 'no-process-env': off,
17
+ 'no-process-exit': off,
18
+ 'no-restricted-modules': off,
19
+ 'no-sync': off,
20
+ },
21
+ };
@@ -0,0 +1,16 @@
1
+ const { error, off } = require('./_rule');
2
+
3
+ module.exports = {
4
+ plugins: ['prettier'],
5
+ rules: {
6
+ 'arrow-body-style': off,
7
+ 'prefer-arrow-callback': off,
8
+ 'prettier/prettier': [
9
+ error,
10
+ {
11
+ singleQuote: true,
12
+ trailingComma: 'es5',
13
+ },
14
+ ],
15
+ },
16
+ };