@evertbouw/ts-strictify v1.1.3
ts-strictify
Runs TypeScript in strict mode on your changed files.

Background
TBD
How it works
When you start working on a new feature or fixing a bug, you will modify the code base in one way or another. ts-strictify will take a look at these changes - and only these changes (!) and will complain, if the files you have touched are not strict compliant.
That is different than TypeScript works. You could check a single file against the compiler, but the compiler would also look up the imports and the imports of the imports. Not exactly what you want, when you are looking for incrementally update path.
Head over to https://cschroeter.net/moving-to-strict-typescript/ for more insights.
Install
With yarn:
yarn add --dev ts-strictifyWith npm:
npm install --save-dev ts-strictifyUsage
With yarn:
yarn ts-strictifyYou can also disable a compiler flag, for example you want to disable strictNullChecks
yarn ts-strictify --strictNullChecks falseYou can find a list of all available options here.
With npx:
npx ts-strictifyWith npm:
- Add
"ts-strictify": "ts-strictify"to the scripts section ofpackage.json. npm run ts-strictify
Pre-Commit Hook
You can run ts-strictify as a pre-commit hook using husky.
yarn add --dev huskyIn package.json, add:
"husky": {
"hooks": {
"pre-commit": "ts-strictify"
}
}Options
Options:
--help Show help [boolean]
--version Show version number [boolean]
--noImplicitAny [boolean] [default: true]
--noImplicitThis [boolean] [default: true]
--alwaysStrict [boolean] [default: true]
--strictBindCallApply [boolean] [default: true]
--strictNullChecks [boolean] [default: true]
--strictFunctionTypes [boolean] [default: true]
--strictPropertyInitialization [boolean] [default: true]
--noEmit [boolean] [default: true]
--targetBranch [string] [default: "master"]
--stagedOnly (ignores targetBranch) [boolean] [default: false]Supported SCM
- Git