The `typescript-strict-plugin` enables gradual adoption of TypeScript's strict mode in existing large projects. Instead of refactoring an entire codebase at once, developers can configure this plugin to apply strict type checking to specific files or directories, or enable strict mode by default and opt out problematic files. The current stable version is 2.4.4. It offers a clear migration path with its `update-strict-comments` script, which automatically adds `//@ts-strict-ignore` comments to files containing strict errors. This allows new or refactored code to benefit from strict checks immediately, while legacy code can be addressed incrementally. It also provides a CLI tool, `tsc-strict`, to ensure compile-time strictness checks, as TypeScript language service plugins typically only affect IDE feedback. The project appears to have an active release cadence, with recent updates addressing bug fixes and compatibility. Its key differentiator is providing a flexible, file-level control over strict mode, effectively solving the "all-or-nothing" barrier for large-scale migrations.
npm install typescript-strict-pluginVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to install `typescript-strict-plugin`, configure it in `tsconfig.json` to enable partial strictness, run the `update-strict-comments` migration script, and integrate `tsc-strict` into your `package.json` scripts for compile-time checking.
Run `npx update-strict-comments` to automatically add `//@ts-strict-ignore` to files with strict errors, ensuring a smooth transition from v1 to v2.
Add `tsc-strict` to your `package.json` scripts (e.g., `"typecheck": "tsc --noEmit && tsc-strict"`) and run it as part of your build pipeline.
Ensure `"strict": false` is explicitly set in your `tsconfig.json` under `compilerOptions`.
Be mindful when passing arguments to `tsc-strict`. Only override specific options when you intend to temporarily deviate from your `tsconfig.json` settings.
Ensure `//@ts-strict-ignore` is the first meaningful line of code or comment in the file you wish to ignore.
Run `npm install --save-dev typescript-strict-plugin` and verify that `"name": "typescript-strict-plugin"` is correctly configured in your `tsconfig.json` under `compilerOptions.plugins`.
Execute `tsc-strict` using `npx tsc-strict` or by defining a script in your `package.json` (e.g., `"scripts": { "strict-check": "tsc-strict" }`) and running `npm run strict-check`.You need to integrate the `tsc-strict` CLI tool into your build process. Add it to a `package.json` script, for example: `"scripts": { "build": "tsc --noEmit && tsc-strict" }`.Ensure `//@ts-strict-ignore` is the very first line of your file. Also, confirm that `"strict": false` is set in your `compilerOptions` within `tsconfig.json` for the plugin to take effect.
No dependency data recorded yet.