-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[TypeScript 3.7] add support for asserts keyword #6574
Copy link
Copy link
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency
Description
Prettier 1.18.2
TypeScript is developing support for assertions in control flow analysis. The functionality is now available in development builds such as v3.7.0-dev.20190928. This ticket requests enabling Prettier support of the new asserts keyword.
--parser typescriptInput:
function assert(value: unknown): asserts value {
throw new Error()
}Output:
SyntaxError: '{' or ';' expected. (1:42)
> 1 | function assert(value: unknown): asserts value {
| ^
2 | throw new Error()
3 | }
4 | Expected behavior:
function assert(value: unknown): asserts value {
throw new Error()
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.scope:dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependencyIssues that cannot be solved inside Prettier itself, and must be fixed in a dependency