|
1 | 1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html |
2 | 2 |
|
3 | 3 | exports[`no-class-inheritance > javascript - es latest > ignoreCodePattern > should report class inheritance with non-matching identifiers 1`] = ` |
4 | | -[ |
5 | | - { |
6 | | - "column": 11, |
7 | | - "endColumn": 22, |
8 | | - "endLine": 1, |
9 | | - "line": 1, |
10 | | - "message": "Unexpected inheritance, use composition instead.", |
11 | | - "messageId": "extends", |
12 | | - "nodeType": "ClassDeclaration", |
13 | | - "ruleId": "no-class-inheritance", |
14 | | - "severity": 2, |
15 | | - }, |
16 | | -] |
| 4 | +{ |
| 5 | + "fixed": false, |
| 6 | + "messages": [ |
| 7 | + { |
| 8 | + "column": 11, |
| 9 | + "endColumn": 22, |
| 10 | + "endLine": 1, |
| 11 | + "line": 1, |
| 12 | + "message": "Unexpected inheritance, use composition instead.", |
| 13 | + "messageId": "extends", |
| 14 | + "nodeType": "ClassDeclaration", |
| 15 | + "ruleId": "no-class-inheritance", |
| 16 | + "severity": 2, |
| 17 | + }, |
| 18 | + ], |
| 19 | + "output": "class Bar extends Foo {}", |
| 20 | + "steps": [ |
| 21 | + { |
| 22 | + "fixed": false, |
| 23 | + "messages": [ |
| 24 | + { |
| 25 | + "column": 11, |
| 26 | + "endColumn": 22, |
| 27 | + "endLine": 1, |
| 28 | + "line": 1, |
| 29 | + "message": "Unexpected inheritance, use composition instead.", |
| 30 | + "messageId": "extends", |
| 31 | + "nodeType": "ClassDeclaration", |
| 32 | + "ruleId": "rule-to-test/no-class-inheritance", |
| 33 | + "severity": 2, |
| 34 | + }, |
| 35 | + ], |
| 36 | + "output": "class Bar extends Foo {}", |
| 37 | + }, |
| 38 | + ], |
| 39 | +} |
17 | 40 | `; |
18 | 41 |
|
19 | 42 | exports[`no-class-inheritance > javascript - es latest > options > ignoreIdentifierPattern > should report class inheritance with non-matching identifiers 1`] = ` |
20 | | -[ |
21 | | - { |
22 | | - "column": 11, |
23 | | - "endColumn": 22, |
24 | | - "endLine": 1, |
25 | | - "line": 1, |
26 | | - "message": "Unexpected inheritance, use composition instead.", |
27 | | - "messageId": "extends", |
28 | | - "nodeType": "ClassDeclaration", |
29 | | - "ruleId": "no-class-inheritance", |
30 | | - "severity": 2, |
31 | | - }, |
32 | | -] |
| 43 | +{ |
| 44 | + "fixed": false, |
| 45 | + "messages": [ |
| 46 | + { |
| 47 | + "column": 11, |
| 48 | + "endColumn": 22, |
| 49 | + "endLine": 1, |
| 50 | + "line": 1, |
| 51 | + "message": "Unexpected inheritance, use composition instead.", |
| 52 | + "messageId": "extends", |
| 53 | + "nodeType": "ClassDeclaration", |
| 54 | + "ruleId": "no-class-inheritance", |
| 55 | + "severity": 2, |
| 56 | + }, |
| 57 | + ], |
| 58 | + "output": "class Bar extends Foo {}", |
| 59 | + "steps": [ |
| 60 | + { |
| 61 | + "fixed": false, |
| 62 | + "messages": [ |
| 63 | + { |
| 64 | + "column": 11, |
| 65 | + "endColumn": 22, |
| 66 | + "endLine": 1, |
| 67 | + "line": 1, |
| 68 | + "message": "Unexpected inheritance, use composition instead.", |
| 69 | + "messageId": "extends", |
| 70 | + "nodeType": "ClassDeclaration", |
| 71 | + "ruleId": "rule-to-test/no-class-inheritance", |
| 72 | + "severity": 2, |
| 73 | + }, |
| 74 | + ], |
| 75 | + "output": "class Bar extends Foo {}", |
| 76 | + }, |
| 77 | + ], |
| 78 | +} |
33 | 79 | `; |
34 | 80 |
|
35 | 81 | exports[`no-class-inheritance > javascript - es latest > reports class inheritance 1`] = ` |
36 | | -[ |
37 | | - { |
38 | | - "column": 11, |
39 | | - "endColumn": 22, |
40 | | - "endLine": 1, |
41 | | - "line": 1, |
42 | | - "message": "Unexpected inheritance, use composition instead.", |
43 | | - "messageId": "extends", |
44 | | - "nodeType": "ClassDeclaration", |
45 | | - "ruleId": "no-class-inheritance", |
46 | | - "severity": 2, |
47 | | - }, |
48 | | -] |
| 82 | +{ |
| 83 | + "fixed": false, |
| 84 | + "messages": [ |
| 85 | + { |
| 86 | + "column": 11, |
| 87 | + "endColumn": 22, |
| 88 | + "endLine": 1, |
| 89 | + "line": 1, |
| 90 | + "message": "Unexpected inheritance, use composition instead.", |
| 91 | + "messageId": "extends", |
| 92 | + "nodeType": "ClassDeclaration", |
| 93 | + "ruleId": "no-class-inheritance", |
| 94 | + "severity": 2, |
| 95 | + }, |
| 96 | + ], |
| 97 | + "output": "class Foo extends Bar {}", |
| 98 | + "steps": [ |
| 99 | + { |
| 100 | + "fixed": false, |
| 101 | + "messages": [ |
| 102 | + { |
| 103 | + "column": 11, |
| 104 | + "endColumn": 22, |
| 105 | + "endLine": 1, |
| 106 | + "line": 1, |
| 107 | + "message": "Unexpected inheritance, use composition instead.", |
| 108 | + "messageId": "extends", |
| 109 | + "nodeType": "ClassDeclaration", |
| 110 | + "ruleId": "rule-to-test/no-class-inheritance", |
| 111 | + "severity": 2, |
| 112 | + }, |
| 113 | + ], |
| 114 | + "output": "class Foo extends Bar {}", |
| 115 | + }, |
| 116 | + ], |
| 117 | +} |
49 | 118 | `; |
50 | 119 |
|
51 | 120 | exports[`no-class-inheritance > typescript > ignoreCodePattern > should report class inheritance with non-matching identifiers 1`] = ` |
52 | | -[ |
53 | | - { |
54 | | - "column": 1, |
55 | | - "endColumn": 9, |
56 | | - "endLine": 1, |
57 | | - "line": 1, |
58 | | - "message": "Unexpected abstract class.", |
59 | | - "messageId": "abstract", |
60 | | - "nodeType": "ClassDeclaration", |
61 | | - "ruleId": "no-class-inheritance", |
62 | | - "severity": 2, |
63 | | - }, |
64 | | -] |
| 121 | +{ |
| 122 | + "fixed": false, |
| 123 | + "messages": [ |
| 124 | + { |
| 125 | + "column": 1, |
| 126 | + "endColumn": 9, |
| 127 | + "endLine": 1, |
| 128 | + "line": 1, |
| 129 | + "message": "Unexpected abstract class.", |
| 130 | + "messageId": "abstract", |
| 131 | + "nodeType": "ClassDeclaration", |
| 132 | + "ruleId": "no-class-inheritance", |
| 133 | + "severity": 2, |
| 134 | + }, |
| 135 | + ], |
| 136 | + "output": "abstract class Bar {}", |
| 137 | + "steps": [ |
| 138 | + { |
| 139 | + "fixed": false, |
| 140 | + "messages": [ |
| 141 | + { |
| 142 | + "column": 1, |
| 143 | + "endColumn": 9, |
| 144 | + "endLine": 1, |
| 145 | + "line": 1, |
| 146 | + "message": "Unexpected abstract class.", |
| 147 | + "messageId": "abstract", |
| 148 | + "nodeType": "ClassDeclaration", |
| 149 | + "ruleId": "rule-to-test/no-class-inheritance", |
| 150 | + "severity": 2, |
| 151 | + }, |
| 152 | + ], |
| 153 | + "output": "abstract class Bar {}", |
| 154 | + }, |
| 155 | + ], |
| 156 | +} |
65 | 157 | `; |
66 | 158 |
|
67 | 159 | exports[`no-class-inheritance > typescript > options > ignoreIdentifierPattern > should report class inheritance with non-matching identifiers 1`] = ` |
68 | | -[ |
69 | | - { |
70 | | - "column": 1, |
71 | | - "endColumn": 9, |
72 | | - "endLine": 1, |
73 | | - "line": 1, |
74 | | - "message": "Unexpected abstract class.", |
75 | | - "messageId": "abstract", |
76 | | - "nodeType": "ClassDeclaration", |
77 | | - "ruleId": "no-class-inheritance", |
78 | | - "severity": 2, |
79 | | - }, |
80 | | -] |
| 160 | +{ |
| 161 | + "fixed": false, |
| 162 | + "messages": [ |
| 163 | + { |
| 164 | + "column": 1, |
| 165 | + "endColumn": 9, |
| 166 | + "endLine": 1, |
| 167 | + "line": 1, |
| 168 | + "message": "Unexpected abstract class.", |
| 169 | + "messageId": "abstract", |
| 170 | + "nodeType": "ClassDeclaration", |
| 171 | + "ruleId": "no-class-inheritance", |
| 172 | + "severity": 2, |
| 173 | + }, |
| 174 | + ], |
| 175 | + "output": "abstract class Bar {}", |
| 176 | + "steps": [ |
| 177 | + { |
| 178 | + "fixed": false, |
| 179 | + "messages": [ |
| 180 | + { |
| 181 | + "column": 1, |
| 182 | + "endColumn": 9, |
| 183 | + "endLine": 1, |
| 184 | + "line": 1, |
| 185 | + "message": "Unexpected abstract class.", |
| 186 | + "messageId": "abstract", |
| 187 | + "nodeType": "ClassDeclaration", |
| 188 | + "ruleId": "rule-to-test/no-class-inheritance", |
| 189 | + "severity": 2, |
| 190 | + }, |
| 191 | + ], |
| 192 | + "output": "abstract class Bar {}", |
| 193 | + }, |
| 194 | + ], |
| 195 | +} |
81 | 196 | `; |
82 | 197 |
|
83 | 198 | exports[`no-class-inheritance > typescript > reports class inheritance 1`] = ` |
84 | | -[ |
85 | | - { |
86 | | - "column": 1, |
87 | | - "endColumn": 9, |
88 | | - "endLine": 1, |
89 | | - "line": 1, |
90 | | - "message": "Unexpected abstract class.", |
91 | | - "messageId": "abstract", |
92 | | - "nodeType": "ClassDeclaration", |
93 | | - "ruleId": "no-class-inheritance", |
94 | | - "severity": 2, |
95 | | - }, |
96 | | -] |
| 199 | +{ |
| 200 | + "fixed": false, |
| 201 | + "messages": [ |
| 202 | + { |
| 203 | + "column": 1, |
| 204 | + "endColumn": 9, |
| 205 | + "endLine": 1, |
| 206 | + "line": 1, |
| 207 | + "message": "Unexpected abstract class.", |
| 208 | + "messageId": "abstract", |
| 209 | + "nodeType": "ClassDeclaration", |
| 210 | + "ruleId": "no-class-inheritance", |
| 211 | + "severity": 2, |
| 212 | + }, |
| 213 | + ], |
| 214 | + "output": "abstract class Foo {}", |
| 215 | + "steps": [ |
| 216 | + { |
| 217 | + "fixed": false, |
| 218 | + "messages": [ |
| 219 | + { |
| 220 | + "column": 1, |
| 221 | + "endColumn": 9, |
| 222 | + "endLine": 1, |
| 223 | + "line": 1, |
| 224 | + "message": "Unexpected abstract class.", |
| 225 | + "messageId": "abstract", |
| 226 | + "nodeType": "ClassDeclaration", |
| 227 | + "ruleId": "rule-to-test/no-class-inheritance", |
| 228 | + "severity": 2, |
| 229 | + }, |
| 230 | + ], |
| 231 | + "output": "abstract class Foo {}", |
| 232 | + }, |
| 233 | + ], |
| 234 | +} |
97 | 235 | `; |
98 | 236 |
|
99 | 237 | exports[`no-class-inheritance > typescript > reports class inheritance 2`] = ` |
100 | | -[ |
101 | | - { |
102 | | - "column": 1, |
103 | | - "endColumn": 9, |
104 | | - "endLine": 1, |
105 | | - "line": 1, |
106 | | - "message": "Unexpected abstract class.", |
107 | | - "messageId": "abstract", |
108 | | - "nodeType": "ClassDeclaration", |
109 | | - "ruleId": "no-class-inheritance", |
110 | | - "severity": 2, |
111 | | - }, |
112 | | - { |
113 | | - "column": 20, |
114 | | - "endColumn": 31, |
115 | | - "endLine": 1, |
116 | | - "line": 1, |
117 | | - "message": "Unexpected inheritance, use composition instead.", |
118 | | - "messageId": "extends", |
119 | | - "nodeType": "ClassDeclaration", |
120 | | - "ruleId": "no-class-inheritance", |
121 | | - "severity": 2, |
122 | | - }, |
123 | | -] |
| 238 | +{ |
| 239 | + "fixed": false, |
| 240 | + "messages": [ |
| 241 | + { |
| 242 | + "column": 1, |
| 243 | + "endColumn": 9, |
| 244 | + "endLine": 1, |
| 245 | + "line": 1, |
| 246 | + "message": "Unexpected abstract class.", |
| 247 | + "messageId": "abstract", |
| 248 | + "nodeType": "ClassDeclaration", |
| 249 | + "ruleId": "no-class-inheritance", |
| 250 | + "severity": 2, |
| 251 | + }, |
| 252 | + { |
| 253 | + "column": 20, |
| 254 | + "endColumn": 31, |
| 255 | + "endLine": 1, |
| 256 | + "line": 1, |
| 257 | + "message": "Unexpected inheritance, use composition instead.", |
| 258 | + "messageId": "extends", |
| 259 | + "nodeType": "ClassDeclaration", |
| 260 | + "ruleId": "no-class-inheritance", |
| 261 | + "severity": 2, |
| 262 | + }, |
| 263 | + ], |
| 264 | + "output": "abstract class Foo extends Bar {}", |
| 265 | + "steps": [ |
| 266 | + { |
| 267 | + "fixed": false, |
| 268 | + "messages": [ |
| 269 | + { |
| 270 | + "column": 1, |
| 271 | + "endColumn": 9, |
| 272 | + "endLine": 1, |
| 273 | + "line": 1, |
| 274 | + "message": "Unexpected abstract class.", |
| 275 | + "messageId": "abstract", |
| 276 | + "nodeType": "ClassDeclaration", |
| 277 | + "ruleId": "rule-to-test/no-class-inheritance", |
| 278 | + "severity": 2, |
| 279 | + }, |
| 280 | + { |
| 281 | + "column": 20, |
| 282 | + "endColumn": 31, |
| 283 | + "endLine": 1, |
| 284 | + "line": 1, |
| 285 | + "message": "Unexpected inheritance, use composition instead.", |
| 286 | + "messageId": "extends", |
| 287 | + "nodeType": "ClassDeclaration", |
| 288 | + "ruleId": "rule-to-test/no-class-inheritance", |
| 289 | + "severity": 2, |
| 290 | + }, |
| 291 | + ], |
| 292 | + "output": "abstract class Foo extends Bar {}", |
| 293 | + }, |
| 294 | + ], |
| 295 | +} |
124 | 296 | `; |
0 commit comments