forked from palantir/tslint
/
test.ts.lint
48 lines (39 loc) · 987 Bytes
/
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
console.log(-1, 0, 1);
console.log(42.42);
~~~~~ ['magic numbers' are not allowed: 42.42]
console.log(-0);
~~ ['magic numbers' are not allowed: -0]
const a = 1337;
const b = {
a: 1338,
b: 0,
}
b.b = 1339;
~~~~ ['magic numbers' are not allowed: 1339]
console.log(1340);
~~~~ ['magic numbers' are not allowed: 1340]
for(let i = 0;i>1341;++i) {
~~~~ ['magic numbers' are not allowed: 1341]
}
throw 1342;
~~~~ ['magic numbers' are not allowed: 1342]
class A {
static test = 1337;
constructor (private a = 1337) {
}
}
enum Test {
key = 1337,
}
const a = 0.1234567801234567890;
a.toFixed(2);
a.toFixed(5);
a.toFixed(10);
a.toString(10);
a.toString(36);
a.toPrecision(3)
a.toPrecision(10)
a.toPrecision(20)
const b = 77.1234;
b.toExponential(4);
b.toExponential(2);