-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Search Terms
AS ANY capitalize upper case
Suggestion
Introducing AS and ANY keywords instead of or in addition to as and any.
When using as or any, many TS programmers need to have their determination and overcome their inferior feeling to break type-safe code. AS and ANY can express their strong will more than as and any do.
Additionally, capitalized words attract notice so that they can be easily fixed at a later point. as and any have average looking. If they are something to avoid, they should have distinct looking. AS and ANY express that we should avoid to use them.
This feature should be configurable on tsconfig to avoid breaking existing codes.
Use Cases
AS and ANY can be used at any place where as and any are used.
Examples
let variable: ANYreq.headers AS Headers
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript