|
1 | 1 | --- |
2 | 2 | source: crates/oxc_linter/src/tester.rs |
3 | 3 | --- |
4 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` |
| 4 | + ⚠ typescript-eslint(consistent-type-definitions): Use `interface` instead of `type`. |
5 | 5 | ╭─[consistent_type_definitions.tsx:1:1] |
6 | 6 | 1 │ type T = { x: number; }; |
7 | 7 | · ──── |
8 | 8 | ╰──── |
9 | | - help: Use an `interface` instead of a `type` |
| 9 | + help: Replace `type T = { x: number; };` with `interface T { x: number; }`. |
10 | 10 |
|
11 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` |
| 11 | + ⚠ typescript-eslint(consistent-type-definitions): Use `interface` instead of `type`. |
12 | 12 | ╭─[consistent_type_definitions.tsx:1:1] |
13 | 13 | 1 │ type T={ x: number; }; |
14 | 14 | · ──── |
15 | 15 | ╰──── |
16 | | - help: Use an `interface` instead of a `type` |
| 16 | + help: Replace `type T={ x: number; };` with `interface T { x: number; }`. |
17 | 17 |
|
18 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` |
| 18 | + ⚠ typescript-eslint(consistent-type-definitions): Use `interface` instead of `type`. |
19 | 19 | ╭─[consistent_type_definitions.tsx:1:1] |
20 | 20 | 1 │ type T= { x: number; }; |
21 | 21 | · ──── |
22 | 22 | ╰──── |
23 | | - help: Use an `interface` instead of a `type` |
| 23 | + help: Replace `type T= { x: number; };` with `interface T { x: number; }`. |
24 | 24 |
|
25 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` |
| 25 | + ⚠ typescript-eslint(consistent-type-definitions): Use `interface` instead of `type`. |
26 | 26 | ╭─[consistent_type_definitions.tsx:2:11] |
27 | 27 | 1 │ |
28 | 28 | 2 │ export type W<T> = { |
29 | 29 | · ──── |
30 | 30 | 3 │ x: T; |
31 | 31 | ╰──── |
32 | | - help: Use an `interface` instead of a `type` |
| 32 | + help: Replace `type W<T> = { |
| 33 | + x: T; |
| 34 | + };` with `interface W<T> { |
| 35 | + x: T; |
| 36 | + }`. |
33 | 37 |
|
34 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 38 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
35 | 39 | ╭─[consistent_type_definitions.tsx:1:1] |
36 | 40 | 1 │ interface T { x: number; } |
37 | 41 | · ───────── |
38 | 42 | ╰──── |
39 | | - help: Use an `type` instead of a `interface` |
| 43 | + help: Replace `interface T { x: number; }` with `type T = { x: number; }`. |
40 | 44 |
|
41 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 45 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
42 | 46 | ╭─[consistent_type_definitions.tsx:1:1] |
43 | 47 | 1 │ interface T{ x: number; } |
44 | 48 | · ───────── |
45 | 49 | ╰──── |
46 | | - help: Use an `type` instead of a `interface` |
| 50 | + help: Replace `interface T{ x: number; }` with `type T = { x: number; }`. |
47 | 51 |
|
48 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 52 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
49 | 53 | ╭─[consistent_type_definitions.tsx:1:1] |
50 | 54 | 1 │ interface T { x: number; } |
51 | 55 | · ───────── |
52 | 56 | ╰──── |
53 | | - help: Use an `type` instead of a `interface` |
| 57 | + help: Replace `interface T { x: number; }` with `type T = { x: number; }`. |
54 | 58 |
|
55 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 59 | + ⚠ typescript-eslint(consistent-type-definitions): Use `interface` instead of `type`. |
| 60 | + ╭─[consistent_type_definitions.tsx:1:1] |
| 61 | + 1 │ type T = { x: "interface" | "type"; }; |
| 62 | + · ──── |
| 63 | + ╰──── |
| 64 | + help: Replace `type T = { x: "interface" | "type"; };` with `interface T { x: "interface" | "type"; }`. |
| 65 | +
|
| 66 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
56 | 67 | ╭─[consistent_type_definitions.tsx:1:1] |
57 | 68 | 1 │ interface A extends B, C { x: number; }; |
58 | 69 | · ───────── |
59 | 70 | ╰──── |
60 | | - help: Use an `type` instead of a `interface` |
| 71 | + help: Replace `interface A extends B, C { x: number; }` with `type A = { x: number; } & B & C`. |
61 | 72 |
|
62 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 73 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
63 | 74 | ╭─[consistent_type_definitions.tsx:1:1] |
64 | 75 | 1 │ interface A extends B<T1>, C<T2> { x: number; }; |
65 | 76 | · ───────── |
66 | 77 | ╰──── |
67 | | - help: Use an `type` instead of a `interface` |
| 78 | + help: Replace `interface A extends B<T1>, C<T2> { x: number; }` with `type A = { x: number; } & B<T1> & C<T2>`. |
68 | 79 |
|
69 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 80 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
70 | 81 | ╭─[consistent_type_definitions.tsx:2:11] |
71 | 82 | 1 │ |
72 | 83 | 2 │ export interface W<T> { |
73 | 84 | · ───────── |
74 | 85 | 3 │ x: T; |
75 | 86 | ╰──── |
76 | | - help: Use an `type` instead of a `interface` |
| 87 | + help: Replace `interface W<T> { |
| 88 | + x: T; |
| 89 | + }` with `type W<T> = { |
| 90 | + x: T; |
| 91 | + }`. |
77 | 92 |
|
78 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 93 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
79 | 94 | ╭─[consistent_type_definitions.tsx:3:6] |
80 | 95 | 2 │ namespace JSX { |
81 | 96 | 3 │ interface Array<T> { |
82 | 97 | · ───────── |
83 | 98 | 4 │ foo(x: (x: number) => T): T[]; |
84 | 99 | ╰──── |
85 | | - help: Use an `type` instead of a `interface` |
| 100 | + help: Replace `interface Array<T> { |
| 101 | + foo(x: (x: number) => T): T[]; |
| 102 | + }` with `type Array<T> = { |
| 103 | + foo(x: (x: number) => T): T[]; |
| 104 | + }`. |
86 | 105 |
|
87 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 106 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
88 | 107 | ╭─[consistent_type_definitions.tsx:3:6] |
89 | 108 | 2 │ global { |
90 | 109 | 3 │ interface Array<T> { |
91 | 110 | · ───────── |
92 | 111 | 4 │ foo(x: (x: number) => T): T[]; |
93 | 112 | ╰──── |
94 | | - help: Use an `type` instead of a `interface` |
| 113 | + help: Replace `interface Array<T> { |
| 114 | + foo(x: (x: number) => T): T[]; |
| 115 | + }` with `type Array<T> = { |
| 116 | + foo(x: (x: number) => T): T[]; |
| 117 | + }`. |
95 | 118 |
|
96 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 119 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
97 | 120 | ╭─[consistent_type_definitions.tsx:3:6] |
98 | 121 | 2 │ declare global { |
99 | 122 | 3 │ interface Array<T> { |
100 | 123 | · ───────── |
101 | 124 | 4 │ foo(x: (x: number) => T): T[]; |
102 | 125 | ╰──── |
103 | | - help: Use an `type` instead of a `interface` |
| 126 | + help: Replace `interface Array<T> { |
| 127 | + foo(x: (x: number) => T): T[]; |
| 128 | + }` with `type Array<T> = { |
| 129 | + foo(x: (x: number) => T): T[]; |
| 130 | + }`. |
104 | 131 |
|
105 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 132 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
106 | 133 | ╭─[consistent_type_definitions.tsx:4:8] |
107 | 134 | 3 │ namespace Foo { |
108 | 135 | 4 │ interface Bar {} |
109 | 136 | · ───────── |
110 | 137 | 5 │ } |
111 | 138 | ╰──── |
112 | | - help: Use an `type` instead of a `interface` |
| 139 | + help: Replace `interface Bar {}` with `type Bar = {}`. |
113 | 140 |
|
114 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 141 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
115 | 142 | ╭─[consistent_type_definitions.tsx:2:19] |
116 | 143 | 1 │ |
117 | 144 | 2 │ export default interface Test { |
118 | 145 | · ───────── |
119 | 146 | 3 │ bar(): string; |
120 | 147 | ╰──── |
121 | | - help: Use an `type` instead of a `interface` |
| 148 | + help: Replace `export default interface Test { |
| 149 | + bar(): string; |
| 150 | + foo(): number; |
| 151 | + }` with `type Test = { |
| 152 | + bar(): string; |
| 153 | + foo(): number; |
| 154 | + } |
| 155 | + export default Test`. |
122 | 156 |
|
123 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 157 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
124 | 158 | ╭─[consistent_type_definitions.tsx:2:19] |
125 | 159 | 1 │ |
126 | 160 | 2 │ export default interface Test { |
127 | 161 | · ───────── |
128 | 162 | 3 │ bar(): string; |
129 | 163 | ╰──── |
130 | | - help: Use an `type` instead of a `interface` |
| 164 | + help: Replace `interface Test { |
| 165 | + bar(): string; |
| 166 | + foo(): number; |
| 167 | + }` with `type Test = { |
| 168 | + bar(): string; |
| 169 | + foo(): number; |
| 170 | + }`. |
131 | 171 |
|
132 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` |
| 172 | + ⚠ typescript-eslint(consistent-type-definitions): Use `interface` instead of `type`. |
133 | 173 | ╭─[consistent_type_definitions.tsx:2:19] |
134 | 174 | 1 │ |
135 | 175 | 2 │ export declare type Test = { |
136 | 176 | · ──── |
137 | 177 | 3 │ foo: string; |
138 | 178 | ╰──── |
139 | | - help: Use an `interface` instead of a `type` |
| 179 | + help: Replace `type Test = { |
| 180 | + foo: string; |
| 181 | + bar: string; |
| 182 | + };` with `interface Test { |
| 183 | + foo: string; |
| 184 | + bar: string; |
| 185 | + }`. |
140 | 186 |
|
141 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 187 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
142 | 188 | ╭─[consistent_type_definitions.tsx:2:19] |
143 | 189 | 1 │ |
144 | 190 | 2 │ export declare interface Test { |
145 | 191 | · ───────── |
146 | 192 | 3 │ foo: string; |
147 | 193 | ╰──── |
148 | | - help: Use an `type` instead of a `interface` |
| 194 | + help: Replace `interface Test { |
| 195 | + foo: string; |
| 196 | + bar: string; |
| 197 | + }` with `type Test = { |
| 198 | + foo: string; |
| 199 | + bar: string; |
| 200 | + }`. |
149 | 201 |
|
150 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` |
| 202 | + ⚠ typescript-eslint(consistent-type-definitions): Use `interface` instead of `type`. |
151 | 203 | ╭─[consistent_type_definitions.tsx:1:10] |
152 | 204 | 1 │ declare
type S={} |
153 | 205 | · ──── |
154 | 206 | ╰──── |
155 | | - help: Use an `interface` instead of a `type` |
| 207 | + help: Replace `type S={}` with `interface S {}`. |
156 | 208 |
|
157 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 209 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
158 | 210 | ╭─[consistent_type_definitions.tsx:1:10] |
159 | 211 | 1 │ declare
interface S {} |
160 | 212 | · ───────── |
161 | 213 | ╰──── |
162 | | - help: Use an `type` instead of a `interface` |
| 214 | + help: Replace `interface S {}` with `type S = {}`. |
163 | 215 |
|
164 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` |
| 216 | + ⚠ typescript-eslint(consistent-type-definitions): Use `interface` instead of `type`. |
165 | 217 | ╭─[consistent_type_definitions.tsx:1:17] |
166 | 218 | 1 │ export declare
type S={} |
167 | 219 | · ──── |
168 | 220 | ╰──── |
169 | | - help: Use an `interface` instead of a `type` |
| 221 | + help: Replace `type S={}` with `interface S {}`. |
170 | 222 |
|
171 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 223 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
172 | 224 | ╭─[consistent_type_definitions.tsx:1:17] |
173 | 225 | 1 │ export declare
interface S {} |
174 | 226 | · ───────── |
175 | 227 | ╰──── |
176 | | - help: Use an `type` instead of a `interface` |
| 228 | + help: Replace `interface S {}` with `type S = {}`. |
177 | 229 |
|
178 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `type` instead of a `interface` |
| 230 | + ⚠ typescript-eslint(consistent-type-definitions): Use `type` instead of `interface`. |
179 | 231 | ╭─[consistent_type_definitions.tsx:1:25] |
180 | 232 | 1 │ declare /* interface */ interface T { x: number; }; |
181 | 233 | · ───────── |
182 | 234 | ╰──── |
183 | | - help: Use an `type` instead of a `interface` |
| 235 | + help: Replace `interface T { x: number; }` with `type T = { x: number; }`. |
184 | 236 |
|
185 | | - ⚠ typescript-eslint(consistent-type-definitions): Use an `interface` instead of a `type` |
| 237 | + ⚠ typescript-eslint(consistent-type-definitions): Use `interface` instead of `type`. |
186 | 238 | ╭─[consistent_type_definitions.tsx:1:20] |
187 | 239 | 1 │ declare /* type */ type T = { x: number; }; |
188 | 240 | · ──── |
189 | 241 | ╰──── |
190 | | - help: Use an `interface` instead of a `type` |
| 242 | + help: Replace `type T = { x: number; };` with `interface T { x: number; }`. |
0 commit comments