-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
88 lines (82 loc) · 2.08 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
const baseRules = require('eslint-config-airbnb-base/rules/style');
const [, ...restricted] = baseRules.rules['no-restricted-syntax'];
const PATHS = require('./settings/paths');
module.exports = {
extends: [
'airbnb',
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
env: {
node: true,
browser: false,
'jest/globals': true,
},
plugins: [
'babel',
'import',
'typescript',
'@typescript-eslint',
'compat',
'jsx-a11y',
'jest',
],
rules: {
// General
'require-atomic-updates': 0,
'@typescript-eslint/no-explicit-any': 0,
'arrow-parens': ['error', 'as-needed'],
'function-paren-newline': ["error", "consistent"],
'object-curly-newline': ["error", { consistent: true }],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'linebreak-style': 0,
'global-require': 0,
'no-restricted-syntax': [2,
...restricted.filter(
r => !['ForOfStatement'].includes(r.selector)
),
],
// React
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/forbid-prop-types': [1, { forbid: ['any']} ],
'react/prefer-stateless-function': [2, { ignorePureComponents: true }],
'react/no-multi-comp': 0,
'consistent-return': 0,
'no-underscore-dangle': 0,
'import/prefer-default-export': 0,
'import/extensions': 0,
// Import
'import/no-unresolved': [2, { commonjs: true }],
// Compat
'compat/compat': 0,
// JSX-a11y
"jsx-a11y/anchor-is-valid": [ "error", {
"components": [ "a" ],
"aspects": [ "noHref", "invalidHref", "preferButton" ]
}],
},
settings: {
'import/resolver': {
node: {
paths: [
PATHS.src,
PATHS.settings,
PATHS.root,
'node_modules',
],
extensions: [
".js",
".tsx",
".ts",
".jsx"
]
},
},
},
};