I have an existing Typescript code base which does not follow Typescript strict mode but I want to have all new added files to be automatically enforced to be in strict mode.
Problem
At the moment it's not possible to accomplish without either fixing all existing code base and enable strict: true in tsconfig.json or relying on good intentions of including @//ts-strict in every new Typescript file
Proposal
Having //@ts-strict-ignore option allows to accomplish this in a smarter way.
First, I can have a configuration like this:
Then I can add //@ts-strict-ignore to all existing Typescript file in my codebase and can incrementally fix these files and remove the comment.
And now, when new file is added, it will be automatically enforced to follow strict mode unless //@ts-strict-ignore is explicitly added.
I'm curious what do you think about the idea or have alternative ways to implement this?
Hey! We have this kind of idea in working progress. We also noticed that it is a bit weird to add those comments in every file, so we decided to add the ts-strict-ignore mode to our tool. Thanks for asking!
Use case
I have an existing Typescript code base which does not follow Typescript strict mode but I want to have all new added files to be automatically enforced to be in strict mode.
Problem
At the moment it's not possible to accomplish without either fixing all existing code base and enable
strict: true
intsconfig.json
or relying on good intentions of including@//ts-strict
in every new Typescript fileProposal
Having
//@ts-strict-ignore
option allows to accomplish this in a smarter way. First, I can have a configuration like this:Then I can add
//@ts-strict-ignore
to all existing Typescript file in my codebase and can incrementally fix these files and remove the comment. And now, when new file is added, it will be automatically enforced to follow strict mode unless//@ts-strict-ignore
is explicitly added.I'm curious what do you think about the idea or have alternative ways to implement this?