-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
117 lines (112 loc) · 2.61 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
107
108
109
110
111
112
113
114
115
116
117
const path = require('path');
const rules = {
'no-underscore-dangle': 'off',
'lines-between-class-members': 'off',
'semi-spacing': 'error',
'no-unused-vars': ['error', {
argsIgnorePattern: 'next|err|ref',
}],
'max-len': ['error', {
code: 160,
}],
'linebreak-style': 0,
'no-alert': 0,
'no-console': ['warn',
{
allow: [
'info',
'error',
'warn',
],
}],
'no-restricted-globals': 0,
'arrow-body-style': 0,
'array-element-newline': [2,
{
ArrayExpression: 'consistent',
ArrayPattern: {
minItems: 3,
},
}],
'array-bracket-newline': ['error', 'consistent'],
'object-curly-newline': [2],
'react/destructuring-assignment': [0, 'always'],
'react/no-access-state-in-setstate': 0,
'react/button-has-type': [0],
'react/jsx-one-expression-per-line': [0],
'react/require-default-props': 0,
'react/prop-types': [1,
{
ignore: [
'location',
'history',
'form',
],
}],
'react/jsx-props-no-multi-spaces': 0,
'react/jsx-indent': [2, 2, { indentLogicalExpressions: true }],
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/label-has-associated-control': [0],
'jsx-a11y/label-has-for': [0],
'jsx-a11y/accessible-emoji': 'off',
'import/prefer-default-export': 'off',
'jsx-a11y/no-autofocus': [0],
};
module.exports = {
env: {
node: true,
browser: true,
},
extends: ['eslint:recommended', 'airbnb'],
settings: {
'import/resolver': {
webpack: {
config: path.join(__dirname, 'aliasResolver.config.js'),
},
},
},
parser: '@babel/eslint-parser',
rules,
overrides: [
{
files: ['.ts', 'src/**/*.ts', 'src/**/*.tsx'],
env: {
node: true,
browser: true,
es6: true,
},
extends: [
'airbnb-typescript',
],
settings: {
'import/resolver': {
webpack: {
config: path.join(__dirname, 'aliasResolver.config.js'),
},
},
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'@typescript-eslint/eslint-plugin',
],
rules: {
...rules,
'@typescript-eslint/type-annotation-spacing': [2, {
before: false,
after: true,
}],
},
},
],
};