This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
/
test.ts.lint
220 lines (182 loc) · 6.09 KB
/
test.ts.lint
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
import ast=AST;
~ [missing whitespace]
~ [missing whitespace]
module M {
export var ast=AST;
~ [missing whitespace]
~ [missing whitespace]
var x:number;
~ [missing whitespace]
var y = (x === 10)?1:2;
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
var zz = (y===4);
~ [missing whitespace]
~ [missing whitespace]
var z=y;
~ [missing whitespace]
~ [missing whitespace]
var a,b;
~ [missing whitespace]
switch(x) {
~ [missing whitespace]
case 1:break;
~ [missing whitespace]
default:break;
~ [missing whitespace]
}
for(x = 1;x <2; ++x){
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
goto:console.log("hi");
~ [missing whitespace]
}
for (x = 2; x--;) {}
for (;;) {}
while(i < 1){
~ [missing whitespace]
~ [missing whitespace]
++i;
}
var q;
q.forEach(()=>3);
~ [missing whitespace]
~ [missing whitespace]
q.forEach(()=>{
~ [missing whitespace]
~ [missing whitespace]
return 3;
});
var r: ()=>string;
~ [missing whitespace]
~ [missing whitespace]
var s: new ()=>string;
~ [missing whitespace]
~ [missing whitespace]
var a = <number>"10";
~ [missing whitespace]
var a = <number> "10";
}
var a;
export=a;
~ [missing whitespace]
~ [missing whitespace]
a.then(() => {
return 1;
}).if(() => {
return 1;
});
var name = "something";
var test = `
<sl-property-group label=${name} Axes">
<div class="repeat"
`;
var withinTemplateExpression = `${name==="something"?"foo":"bar"}`;
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
var withinTemplateExpression = `${name === "something" ? "foo" : "bar"}`;
var objectInsideTemplateExpression = `${({foo:"bar"}).foo}`;
~ [missing whitespace]
var objectInsideTemplateExpression = `${({foo: "bar"}).foo}`;
import { importA } from "libA";
import { importB }from "libB";
~ [missing whitespace]
import{importC}from"libC";
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
import moduleD, {importD}from "libD";
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
import {importD, importE} from "libD";
~ [missing whitespace]
~ [missing whitespace]
import {importF as F} from "libF";
~ [missing whitespace]
~ [missing whitespace]
import {importF as F,importG as G} from "libF";
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
import {
importA,
importB
} from "libC";
export default 123;
const D = 123;
export{ D as default }; // failure
~ [missing whitespace]
export function each(obj, iterator, context) {
//
}
export {each as forEach};
~ [missing whitespace]
~ [missing whitespace]
import "libE";
const E = 123;
const F = 123;
export {E,F};
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
function foobar(){}
~ [missing whitespace]
function foorbar()
{}
if (){
~ [missing whitespace]
//
} else{}
~ [missing whitespace]
if ()
{}
else
{}
/* some comment */{
// some code with a preceding comment
}
{
const foo = 123;
// code that just wants to be encapsulated in a block scope
}
const foo = { ... bar };
~ [invalid whitespace]
const foo = [ ... bar ];
~ [invalid whitespace]
function foo (bar, ... baz) {}
~ [invalid whitespace]
const { foo, ... bar } = baz;
~ [invalid whitespace]
type A = number|string;
~ [missing whitespace]
~ [missing whitespace]
type B = number|string|{result: string};
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
type C = {result: string}&{type: "A"|"B"};
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
~ [missing whitespace]
class a {
private x= 1;
~ [missing whitespace]
y= 1;
~ [missing whitespace]
public z=0;
~ [missing whitespace]
~ [missing whitespace]
}