-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
93 lines (82 loc) · 2.35 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
const OFF = 0;
const WARNING = 1;
const ERROR = 2;
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['tsconfig.json'],
ecmaVersion: 2021,
sourceType: 'module'
},
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'airbnb-typescript',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:unicorn/recommended',
'plugin:jest/recommended'
],
plugins: ['import', 'unicorn', 'jest', 'prettier'],
env: {
node: true,
browser: true,
es2020: true
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts']
},
'import/resolver': {
typescript: {
alwaysTryTypes: true
}
}
},
rules: {
// Prettier
'prettier/prettier': ERROR,
'prefer-arrow-callback': OFF,
'react/display-name': OFF,
'react/prop-types': OFF,
// Import rules
'import/named': OFF,
'import/namespace': OFF,
'import/default': OFF,
'import/no-named-as-default-member': OFF,
'import/no-extraneous-dependencies': OFF,
'import/no-cycle': ERROR,
'import/newline-after-import': ERROR,
'import/order': [
ERROR,
{
'newlines-between': 'always',
pathGroups: [{ pattern: 'react**', group: 'builtin', position: 'before' }],
groups: [['builtin', 'external'], ['internal', 'parent', 'index'], ['object', 'type', 'sibling']],
pathGroupsExcludedImportTypes: []
}
],
// Unicorn
'unicorn/no-null': OFF,
'unicorn/prevent-abbreviations': OFF,
'unicorn/empty-brace-spaces': ERROR,
'unicorn/filename-case': OFF,
'unicorn/prefer-node-protocol': OFF,
'unicorn/prefer-module': OFF,
'unicorn/explicit-length-check': OFF,
// Main
'@typescript-eslint/lines-between-class-members': [ERROR, 'always', { exceptAfterSingleLine: true }],
'@typescript-eslint/no-unused-vars': [ERROR, { argsIgnorePattern: '^_$' }],
'@typescript-eslint/comma-dangle': [ERROR, 'never'],
'arrow-body-style': OFF,
'arrow-spacing': ERROR,
'react/jsx-filename-extension': OFF,
'max-params': [ERROR, 6],
'max-len': [
ERROR,
{ code: 120, ignorePattern: "(?:^import |export|Path|Rect|Svg|LinearGradient)|(?:it|describe)\\('[\\w\\s]+'" }
],
'comma-dangle': [ERROR, 'never']
}
};