This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
/
test.ts.fix
80 lines (60 loc) · 1.93 KB
/
test.ts.fix
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
"use strict"
import { Something } from "some-package"
export { SomethingElse } from "another-package"
enum Sides {
'<- Left',
'Right ->'
}
const octalEscapeSequence = '\1'
const octalEscapeSequence2 = '\7'
const octalEscapeSequence3 = '\77'
const octalEscapeSequence4 = '\377'
const octalEscapeSequence5 = '\123'
// Prefix (\47) is an octal escape sequence
const octalEscapeSequence6 = '\477'
const octalEscapeSequence7 = '\\77 \77 \\37 \\77'
const notOctalEscapeSequence = `\877`
const notOctalEscapeSequence2 = `\017`
const notOctalEscapeSequence3 = `\t`
const notOctalEscapeSequence4 = `\0`
const notOctalEscapeSequence4 = `\\77 \\37 \\\\47 \\\\\\77`
function strictFunction() {
"use strict"
const str = `use strict`
}
var single = `single`;
var double = `married`;
var singleWithinDouble = `'singleWithinDouble'`;
var doubleWithinSingle = `"doubleWithinSingle"`;
var tabNewlineWithinSingle = `tab\tNewline\nWithinSingle`;
var array: Array<"literal string"> = [];
var arrayTwo: Array<"literal string" | number> = [];
var arrayThree: Array<"literal string" | "hello world"> = [];
var arrayFour: Array<"literal string" | "hello world" | "foo bar"> = [];
var array: Array<"literal string"> = [];
var arrayTwo: Array<"literal string" & number> = [];
var arrayFour: Array<"literal string" | "hello world" & "foo bar"> = [];
function test<T extends "generic">() {
}
function test<T extends ("generic" & number)>() {
}
declare var obj: {
helloWorldString: string
}
interface obj2 {
helloWorldString: string
}
type objHello = typeof obj["helloWorldString"]
type objHello2 = obj2["helloWorldString"]
let helloValue = obj[`helloWorldString`]
helloValue = obj[`helloWorldString`]
const obj3: {
value: typeof obj["helloWorldString"]
} = {
value: obj[`helloWorldString`]
}
const callback = <U extends "generic">() => `hi` as number | string
var hello: `world`;
`escaped'quotemark`;
// "avoid-template" option is not set.
`foo`;