-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
84 lines (83 loc) · 2.31 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
const isProd = process.env.NODE_ENV === 'production';
const defaultRules = {
'no-bitwise': ['error', { allow: ['&', '|', '^'] }],
'arrow-body-style': [2, 'as-needed'],
'arrow-parens': ['error', 'as-needed'],
'class-methods-use-this': 0,
'comma-dangle': [2, 'always-multiline'],
'no-underscore-dangle': 0,
'max-len': 0,
'newline-per-chained-call': 0,
'no-confusing-arrow': 0,
'no-console': [isProd ? 'error' : 'warn', { allow: ['warn', 'error'] }],
'no-debugger': isProd ? 'error' : 'warn',
'no-plusplus': 0,
'no-use-before-define': 0,
'prefer-template': 2,
'prettier/prettier': 'error',
'require-yield': 0,
'no-await-in-loop': 0,
};
module.exports = {
overrides: [
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
plugins: ['prettier', '@typescript-eslint'],
extends: [
'airbnb-base',
'prettier',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
...defaultRules,
'no-shadow': 0,
'no-unused-vars': 0,
'import/prefer-default-export': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/member-delimiter-style': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unused-vars': [
isProd ? 2 : 1,
{ ignoreRestSiblings: true },
],
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-non-null-assertion': 0,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
},
},
},
{
files: ['**/*.js'],
extends: ['airbnb-base', 'prettier'],
env: {
node: true,
jest: true,
es6: true,
},
plugins: ['prettier'],
rules: {
...defaultRules,
'no-unused-vars': isProd ? 'error' : 'warn',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
},
},
},
],
};