Skip to content

Commit da20349

Browse files
authored
Docs: erasableSyntaxOnly should mention type assertions (#3465)
1 parent 5daeca1 commit da20349

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/tsconfig-reference/copy/en/options/erasableSyntaxOnly.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ That means the following constructs are not supported:
1313
* `namespace`s and `module`s with runtime code
1414
* parameter properties in classes
1515
* Non-ECMAScript `import =` and `export =` assignments
16+
* `<prefix>`-style type assertions
1617

1718
```ts
1819
// ❌ error: An `import ... = require(...)` alias
@@ -43,6 +44,9 @@ enum Direction {
4344
Left,
4445
Right,
4546
}
47+
48+
// ❌ error: <prefix>-style type assertion.
49+
const num = <number>1;
4650
```
4751

4852
Similar tools like [ts-blank-space](https://github.com/bloomberg/ts-blank-space) or [Amaro](https://github.com/nodejs/amaro) (the underlying library for type-stripping in Node.js) have the same limitations.

0 commit comments

Comments
 (0)