-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
78 lines (77 loc) · 2.61 KB
/
index.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
const bestPractices = require.resolve('./rules/best-practices');
const errors = require.resolve('./rules/errors');
const es6 = require.resolve('./rules/es6');
const node = require.resolve('./rules/node');
const style = require.resolve('./rules/style');
const variables = require.resolve('./rules/variables');
const prettier = require.resolve('./rules/prettier');
const jestRules = require.resolve('./rules/jest');
const unicornRules = require.resolve('./rules/unicorn');
const importRules = require.resolve('./rules/import');
module.exports = {
extends: [
'eslint-config-airbnb-base',
'eslint:recommended',
'plugin:jest/recommended',
'plugin:unicorn/recommended',
'eslint-config-prettier',
bestPractices,
errors,
es6,
node,
style,
variables,
prettier,
jestRules,
unicornRules,
importRules,
],
plugins: ['jest', 'prettier'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
env: {
node: true,
},
rules: {
strict: 'error',
},
overrides: [
{
files: ['**/*.spec.js', '**/*.test.js', '**/tests-*.js', '**/*.spec.ts', '**/*.test.ts', '**/tests-*.ts'],
rules: {
'array-bracket-newline': 'off',
'array-element-newline': 'off',
'id-length': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-nested-callbacks': 'off',
'max-statements': 'off',
'newline-after-var': 'off',
'no-process-env': 'off',
'no-undefined': 'off',
'object-curly-newline': 'off',
'padding-line-between-statements': [
'error',
{blankLine: 'always', prev: '*', next: 'return'},
{blankLine: 'any', prev: ['const', 'let', 'var'], next: '*'},
{blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var']},
{blankLine: 'always', prev: 'directive', next: '*'},
{blankLine: 'any', prev: ['for', 'do', 'while'], next: '*'},
{blankLine: 'any', prev: '*', next: 'for'},
{blankLine: 'any', prev: 'import', next: '*'},
{blankLine: 'any', prev: 'import', next: 'import'},
{blankLine: 'any', prev: 'if', next: '*'},
{blankLine: 'any', prev: 'function', next: '*'},
{blankLine: 'any', prev: '*', next: 'function'},
{blankLine: 'any', prev: '*', next: 'export'},
{blankLine: 'any', prev: '*', next: 'cjs-export'},
{blankLine: 'any', prev: 'cjs-import', next: '*'},
{blankLine: 'any', prev: 'cjs-import', next: 'cjs-import'},
],
'unicorn/prefer-prototype-methods': 'off',
},
},
],
};