IssueRaiser

Strict type-checking on a per-file basis "@ts-strict"

## Search Terms strict per file ## Suggestion Currently in the process of converting a moderate-sized javascript project to typescript. Would love to be able to enable strict type-checks on a per-file basis. ## Use Cases Enabling strict mode for the entire project is a daunting task that presents a barrier to adoption (and using typescript without strict mode turned on is like locking the doors on a convertible....it's probably better than nothing, but it's not gonna keep you safe). ## Examples ``` //@ts-strict ``` ## Checklist My suggestion meets these guidelines: * [X] This wouldn't be a breaking change in existing TypeScript / JavaScript code * [X] This wouldn't change the runtime behavior of existing JavaScript code * [X] This could be implemented without emitting different JS based on the types of the expressions * [X] This isn't a runtime feature (e.g. new expression-level syntax)

Posted by lukewis on Nov 2, 2018, 12:31 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,000 issues0 comments

github (Software)

Strict type-checking on a per-file basis "@ts-strict"

lukewisNov 2, 2018, 12:31 AM

## Search Terms strict per file ## Suggestion Currently in the process of converting a moderate-sized javascript project to typescript. Would love to be able to enable strict type-checks on a per-file basis. ## Use Cases Enabling strict mode for the entire project is a daunting task that presents a barrier to adoption (and using typescript without strict mode turned on is like locking the doors on a convertible....it's probably better than nothing, but it's not gonna keep you safe). ## Examples ``` //@ts-strict ``` ## Checklist My suggestion meets these guidelines: * [X] This wouldn't be a breaking change in existing TypeScript / JavaScript code * [X] This wouldn't change the runtime behavior of existing JavaScript code * [X] This could be implemented without emitting different JS based on the types of the expressions * [X] This isn't a runtime feature (e.g. new expression-level syntax)

Comments (0)

No comments yet. Start the discussion.

Comment on this issue