This repository was archived by the owner on Jun 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
102 lines (101 loc) · 2.65 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
// see https://medium.com/@myylow/how-to-keep-the-airbnb-eslint-config-when-moving-to-typescript-1abb26adb5c6
module.exports = {
parser: '@typescript-eslint/parser',
root: true,
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
env: {
es6: true,
node: true,
},
extends: ['airbnb-base'],
rules: {
'arrow-parens': ['error', 'always'],
eqeqeq: ['error', 'always'],
'no-console': 0,
'no-await-in-loop': 0,
'no-loop-func': 0,
'no-param-reassign': 0,
'no-mixed-operators': 0,
'no-implicit-coercion': 'error',
'import/no-dynamic-require': 0,
'import/prefer-default-export': 0,
'import/extensions': 0,
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: false,
},
AssignmentExpression: {
array: false,
object: false,
},
},
{
enforceForRenamedProperties: false,
},
],
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'no-useless-constructor': 'off',
'no-undef': 'off',
'no-dupe-class-members': 'off',
'lines-between-class-members': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'/commands/**/*.ts',
'/release/**/*.ts',
'/documentation/**/*.ts',
'**/*.test.ts',
'/test/**/*.ts',
'/src/types/**/**.d.ts',
],
},
],
},
settings: {
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
},
},
overrides: [{
files: [
'**/*.{ts,tsx}',
// 'test/**/*.{ts,tsx}',
// 'commands/**/*.{ts,tsx}',
],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-use-before-define': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/strict-boolean-expressions': [
'error',
{
allowString: false,
allowNumber: false,
allowNullableObject: false,
},
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-dupe-class-members': ['error'],
'@typescript-eslint/explicit-module-boundary-types': ['error', { allowArgumentsExplicitlyTypedAsAny: true }],
},
parserOptions: {
project: './tsconfig.json',
},
}],
};