-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.js
76 lines (76 loc) · 2.42 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
module.exports = {
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'import-newlines',
],
extends: [
'airbnb-typescript',
'plugin:import/recommended',
'plugin:import/typescript',
],
parserOptions: {
project: ['tsconfig.eslint.json'],
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
node: true,
jest: true,
},
rules: {
indent: ['error', 4, { SwitchCase: 1 }],
'max-len': ['error', { code: 120, ignoreUrls: true }],
'@typescript-eslint/indent': ['error', 4],
'arrow-body-style': 0,
'react/jsx-filename-extension': 0,
'@typescript-eslint/no-shadow': 0,
'import/no-extraneous-dependencies': 'off',
'import/no-cycle': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'import-newlines/enforce': ['error', 2, 120],
'import/order': [
'error',
{
'groups': [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
],
'pathGroups': [
// Place all react libraries before external
{
'pattern': '*react*',
'group': 'external',
'position': 'before',
},
// Place all our libraries after react-like
{
'pattern': '@adguard/*',
'group': 'external',
'position': 'after',
},
// Separate group for all .pcss styles
{
'pattern': '*.pcss',
'group': 'object',
'patternOptions': { 'matchBase': true },
'position': 'after',
},
],
'pathGroupsExcludedImportTypes': ['builtin', 'react'],
'newlines-between': 'always',
// To include "side effect imports" in plugin checks
// (like "import 'styles.pcss';")
'warnOnUnassignedImports': true,
},
],
},
};