forked from jsforce/jsforce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
110 lines (109 loc) · 3.54 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
module.exports = {
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'eslint-config-prettier',
],
env: {
browser: true,
node: true,
es6: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: [
'./packages/**/tsconfig.json',
'./packages/**/test/tsconfig.json',
'./tsconfig.json',
'./test/tsconfig.json',
],
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
'eslint-plugin-import',
'eslint-plugin-jsdoc',
],
rules: {
// TODO: turn all of these that are 'off' to 'error'
// turn the rule off everywhere. Then, in overrides, turn it on for just src
'import/no-extraneous-dependencies': 'off',
// Override @typescript-eslint/recommended
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-shadow': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/restrict-template-expressions': 'error',
// Custom @typescript-eslint
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@typescript-eslint/return-await': 'error',
// turning off the base rule is recommended by ts-eslint
'no-return-await': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/quotes': [
'error',
'single',
{
avoidEscape: true,
},
],
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
},
ignorePatterns: ['*.js'],
overrides: [
{
files: ['src/**'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
includeTypes: false,
devDependencies: false,
peerDependencies: false,
bundledDependencies: false,
optionalDependencies: false,
},
],
},
},
],
};