-
Notifications
You must be signed in to change notification settings - Fork 94
/
.eslintrc.yaml
120 lines (117 loc) · 3.63 KB
/
.eslintrc.yaml
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
118
119
120
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
- prettier
- plugin:deprecation/recommended
env:
node: true
es6: true
ignorePatterns:
[
"**/scripts",
"**/__mocks__",
"**/lib",
"webpack.config.js",
"**/*wdio.conf.ts",
"**/features/",
"samples/__integration__/",
"**/out",
"**/results",
"**/src/webviews",
]
overrides:
- files: "**/__tests__/**"
rules:
no-magic-numbers: off
"@typescript-eslint/require-await": warn
"@typescript-eslint/no-misused-promises": warn
"@typescript-eslint/no-unsafe-return": off
"@typescript-eslint/restrict-plus-operands": warn
"@typescript-eslint/restrict-template-expressions": warn
"@typescript-eslint/explicit-function-return-type": off
"@typescript-eslint/unbound-method": off
zowe-explorer/no-floating-promises: warn
parser: "@typescript-eslint/parser"
parserOptions:
ecmaVersion: 6
sourceType: module
project:
- "**/tsconfig.json"
- "**/tsconfig-tests.json"
plugins:
- "@typescript-eslint"
- zowe-explorer
rules:
"@typescript-eslint/await-thenable": off
"@typescript-eslint/consistent-type-assertions": warn
"@typescript-eslint/explicit-function-return-type": [
"error",
{
# We only disallow the rules that provide value (i.e. that found some errors while configuring)
# Documentation: https://typescript-eslint.io/rules/explicit-function-return-type
allowHigherOrderFunctions: false,
allowFunctionsWithoutTypeParameters: false,
# Disabling (i.e. setting to `false`) the following rule will force us to unnecessarily type built-in functions
# For example, to find the index of a profile in a profiles array we will have to go:
# FROM: profiles.findIndex((profile) => profile.name === "my_profile"))
# TO: profiles.findIndex((profile): boolean => profile.name === "my_profile"))
allowTypedFunctionExpressions: true,
},
]
"@typescript-eslint/explicit-member-accessibility": error
# There are several errors falling under these rules; resolve
"@typescript-eslint/no-floating-promises": off
"@typescript-eslint/no-unsafe-assignment": off
"@typescript-eslint/no-unsafe-argument": off
"@typescript-eslint/no-unsafe-call": off
"@typescript-eslint/no-unsafe-member-access": off
"@typescript-eslint/no-shadow": error
"@typescript-eslint/no-unused-expressions": error
"@typescript-eslint/no-var-requires": warn
array-callback-return: error
# complexity:
# - warn
# - 15
constructor-super: error
curly: warn
getter-return: error
max-len:
- warn
- code: 150
# no-array-constructor: off
no-console: error
no-const-assign: error
no-dupe-keys: error
no-duplicate-case: error
no-duplicate-imports: error
no-extra-bind: warn
no-extra-semi: error
# no-func-assign: error
no-implicit-globals: error
# no-import-assign: error
no-irregular-whitespace: warn
no-magic-numbers:
- warn
- "ignore": [-2, -1, 0, 1, 2, 4]
no-multiple-empty-lines: warn
no-return-await: warn
no-sequences: warn
no-shadow: off
no-sparse-arrays: warn
# no-this-before-super: error
# no-undef: warn
no-unreachable: error
no-unsafe-negation: error
no-unused-expressions: off
no-unused-vars: off
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
# prefer-const: warn
prefer-object-spread: warn
space-in-parens: warn
zowe-explorer/no-floating-promises: error
zowe-explorer/no-unmocked-core-modules:
- error
- coreModuleNames:
- fs
filePathPattern: ".*\\.unit\\.test\\..*"
root: true