-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
.eslintrc.js
106 lines (101 loc) · 2.39 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
const skipWords = require('./config/eslint/spellCheckerSkip');
const jsconfig = require('./jsconfig.json');
const paths = jsconfig.compilerOptions.paths;
const aliases = Object.keys(paths);
module.exports = {
env: {
es6: true,
jest: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:import/errors',
'plugin:import/warnings',
'prettier',
],
globals: {
__LIB_VERSION__: true,
LIBRARY_NAME: true,
ENV_DEVELOPMENT: true,
},
ignorePatterns: ['playground'],
overrides: [
{
files: ['./packages/*/src/**/*.js'],
excludedFiles: '*.test.js',
rules: {
'import/no-relative-parent-imports': 2,
},
},
],
parser: 'babel-eslint',
parserOptions: {
babelOptions: {
configFile: 'config/babel/babel.config.js',
},
ecmaFeatures: {
impliedStrict: true,
},
ecmaVersion: 10,
sourceType: 'module',
},
plugins: ['jest', 'spellcheck'],
rules: {
'import/extensions': [2, 'never'],
'import/first': 2,
'import/newline-after-import': 2,
'import/no-self-import': 2,
'import/no-unresolved': [2, { ignore: aliases }],
'import/no-useless-path-segments': 2,
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
},
'newlines-between': 'always',
pathGroups: [{ pattern: `*(${aliases.join('|')})`, group: 'internal' }],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
'jest/expect-expect': 0,
'jest/no-identical-title': 0,
'jest/no-standalone-expect': 0,
'max-params': [2, { max: 3 }],
'no-console': 2,
'no-duplicate-imports': 2,
'no-implicit-globals': 2,
'no-lonely-if': 2,
'no-multi-spaces': 1,
'no-prototype-builtins': 0,
'no-trailing-spaces': [2, { ignoreComments: false }],
'no-unneeded-ternary': 2,
'no-unused-expressions': 2,
'no-useless-catch': 2,
'no-useless-computed-key': 2,
'no-useless-return': 2,
'no-var': 2,
'no-warning-comments': 2,
'object-shorthand': [2, 'always', { avoidQuotes: true }],
'prefer-const': 2,
'sort-keys': [
1,
'asc',
{
natural: true,
minKeys: 4,
},
],
'spellcheck/spell-checker': [
1,
{
strings: false,
identifiers: false,
skipWords,
},
],
},
};