Skip to content

Commit 0ddd8a0

Browse files
committed
chore: ut folder add eslint config
1 parent 9197e05 commit 0ddd8a0

File tree

2 files changed

+198
-2
lines changed

2 files changed

+198
-2
lines changed

test/ut/.eslintrc.yaml

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
parser: "@typescript-eslint/parser"
2+
parserOptions:
3+
ecmaVersion: 6
4+
sourceType: module
5+
ecmaFeatures:
6+
modules: true
7+
project: "./test/ut/tsconfig.json"
8+
plugins: ["@typescript-eslint"]
9+
env:
10+
browser: true
11+
node: true
12+
es6: false
13+
jest: true
14+
globals:
15+
jQuery: true
16+
Promise: true
17+
rules:
18+
no-console:
19+
- 2
20+
-
21+
allow:
22+
- "warn"
23+
- "error"
24+
no-constant-condition: 0
25+
comma-dangle: 2
26+
no-debugger: 2
27+
no-dupe-keys: 2
28+
no-empty-character-class: 2
29+
no-ex-assign: 2
30+
no-extra-boolean-cast: 0
31+
no-func-assign: 2
32+
no-inner-declarations: 2
33+
no-invalid-regexp: 2
34+
no-negated-in-lhs: 2
35+
no-obj-calls: 2
36+
no-sparse-arrays: 2
37+
no-unreachable: 2
38+
use-isnan: 2
39+
valid-typeof: 2
40+
block-scoped-var: 0
41+
curly:
42+
- 2
43+
- "all"
44+
eqeqeq:
45+
- 2
46+
- "allow-null"
47+
guard-for-in: 2
48+
no-else-return: 0
49+
no-labels:
50+
- 2
51+
-
52+
allowLoop: true
53+
no-eval: 2
54+
no-extend-native: 2
55+
no-extra-bind: 0
56+
no-implied-eval: 2
57+
no-iterator: 2
58+
no-irregular-whitespace: 2
59+
no-lone-blocks: 2
60+
no-loop-func: 2
61+
no-multi-str: 2
62+
no-native-reassign: 2
63+
no-new-wrappers: 2
64+
no-octal: 2
65+
no-octal-escape: 2
66+
no-proto: 2
67+
no-redeclare: 0
68+
no-self-compare: 2
69+
no-unneeded-ternary: 2
70+
no-with: 2
71+
radix: 2
72+
wrap-iife:
73+
- 2
74+
- "any"
75+
no-delete-var: 2
76+
no-dupe-args: 2
77+
no-duplicate-case: 2
78+
no-label-var: 2
79+
no-shadow-restricted-names: 2
80+
no-undef: 2
81+
no-undef-init: 2
82+
no-use-before-define: 0
83+
brace-style:
84+
- 2
85+
- "stroustrup"
86+
- {}
87+
comma-spacing:
88+
- 2
89+
-
90+
before: false
91+
after: true
92+
comma-style:
93+
- 2
94+
- "last"
95+
new-parens: 2
96+
no-array-constructor: 2
97+
no-multi-spaces:
98+
- 1
99+
-
100+
ignoreEOLComments: true
101+
exceptions:
102+
Property: true
103+
no-new-object: 2
104+
no-spaced-func: 2
105+
no-trailing-spaces: 2
106+
no-extra-parens:
107+
- 2
108+
- "functions"
109+
no-mixed-spaces-and-tabs: 2
110+
one-var:
111+
- 2
112+
- "never"
113+
operator-linebreak:
114+
- 2
115+
- "before"
116+
-
117+
overrides:
118+
"=": "after"
119+
quotes:
120+
- 2
121+
- "single"
122+
semi:
123+
- 2
124+
- "always"
125+
semi-spacing: 2
126+
keyword-spacing: 2
127+
key-spacing:
128+
- 2
129+
-
130+
beforeColon: false
131+
afterColon: true
132+
space-before-function-paren:
133+
- 2
134+
-
135+
anonymous: "always"
136+
named: "never"
137+
space-before-blocks:
138+
- 2
139+
- "always"
140+
computed-property-spacing:
141+
- 2
142+
- "never"
143+
space-in-parens:
144+
- 2
145+
- "never"
146+
space-unary-ops: 2
147+
spaced-comment: 0
148+
149+
max-nested-callbacks:
150+
- 1
151+
- 5
152+
max-depth:
153+
- 1
154+
- 6
155+
max-len:
156+
- 2
157+
- 120
158+
- 4
159+
-
160+
ignoreUrls: true
161+
ignoreComments: true
162+
max-params:
163+
- 1
164+
- 15
165+
166+
space-infix-ops: 2
167+
dot-notation:
168+
- 2
169+
-
170+
allowKeywords: true
171+
allowPattern: "^catch$"
172+
173+
arrow-spacing: 2
174+
constructor-super: 2
175+
no-confusing-arrow:
176+
- 2
177+
-
178+
allowParens: true
179+
no-class-assign: 2
180+
no-const-assign: 2
181+
# no-dupe-class-members: 2
182+
no-this-before-super: 0
183+
no-var: 0
184+
no-duplicate-imports: 2
185+
prefer-rest-params: 0
186+
unicode-bom: 2
187+
max-statements-per-line: 2
188+
189+
no-useless-constructor: 0
190+
191+
192+
"@typescript-eslint/no-unused-vars":
193+
- 1
194+
-
195+
vars: "local"
196+
args: "none"

test/ut/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"noImplicitAny": true,
55
"strictBindCallApply": true,
66

7-
"noImplicitThis": true,
7+
"noImplicitThis": false,
88

99
// https://github.com/ezolenko/rollup-plugin-typescript2/issues/12#issuecomment-536173372
1010
"moduleResolution": "Node",
1111

1212
"pretty": true
1313
},
1414
"include": [
15-
"**/*.ts"
15+
"spec/**/*.ts",
1616
],
1717
"exclude": [
1818
]

0 commit comments

Comments
 (0)