Skip to content

Commit

Permalink
Clarify the declare hazard (#35)
Browse files Browse the repository at this point in the history
Let's avoid folk thinking that we're introducing a hazard.

Signed-off-by: Rob Palmer <[email protected]>
  • Loading branch information
robpalme authored Jan 29, 2025
1 parent 4eeb96b commit 736983c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/unsupported_syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ See https://github.com/microsoft/TypeScript/issues/51825 for more information.

### The `declare ...` hazard

_Note: This section describes a potential hazard in the TypeScript language that exists with or without `ts-blank-space`.
It is described here only because adopting type-stripping may lead to developers reaching for `declare` as part of migration._

As with `declare const ...`, while `ts-blank-space` will erase syntax such as `declare enum ...` and `declare namespace ...` without error it should be used with understanding and mild caution.
`declare` in TypeScript is an _assertion_ by the author that a value will exist at runtime.

Expand Down

0 comments on commit 736983c

Please sign in to comment.