Skip to content

Commit c576252

Browse files
committed
feat: add TS1360 section
1 parent 0b4d413 commit c576252

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

errors/includes/TS1xxx/TS1360.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## TS1360
2+
3+
> error TS1360: Class constructor may not be a generator.
4+
5+
### Broken Code ❌
6+
7+
```ts
8+
class SomeClass {
9+
*constructor() {
10+
// ...
11+
}
12+
}
13+
```
14+
15+
### Fixed Code ✔️
16+
17+
You can't name generators as `constructor`:
18+
19+
<!-- prettier-ignore-start -->
20+
{% codeblock lang:ts mark:2 %}
21+
class SomeClass {
22+
*builder() {
23+
// ...
24+
}
25+
}
26+
{% endcodeblock %}
27+
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)