Registry / devops / tsc-strict

tsc-strict

JSON →
library2.4.5jsnpmunverified

A TypeScript Language Service plugin and CLI tool that enables incremental migration to strict mode by allowing per-file opt-out via `//@ts-strict-ignore` comments. Version 2.4.5, stable. Key differentiators: works in IDE via TS plugin (shows strict errors in editor) and also provides a `tsc-strict` CLI for build-time checking — unlike native `strict: true` which forces all files at once. Supports path-based inclusion/exclusion and minimatch patterns. ESM and CJS compatible orchestrated through tsconfig plugins array.

npm install tsc-strict
INSTALL
IMPORT
SIG · TSC-STRICT
T
tsc-strict
devopsjavascriptv2.4.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tsc-strict plugin
// In tsconfig.json "plugins": [{"name": "tsc-strict"}]
import tscStrict from 'tsc-strict'
This is a TypeScript Language Service plugin, not a module. It is loaded via tsconfig, not imported in source code.
CLI (tsc-strict)
npx tsc-strict
The CLI is invoked as a bin script, not imported programmatically.
CLI (update-strict-comments)
npx update-strict-comments
Migration script to add `//@ts-strict-ignore` to files with strict errors.

Shows installation, tsconfig plugin configuration, migration script, and CLI usage for incremental strict mode adoption.

// 1. Install npm i --save-dev tsc-strict // 2. Add to tsconfig.json: { "compilerOptions": { "strict": false, "plugins": [{ "name": "tsc-strict" }] } } // 3. Run migration script to auto-add ignore comments to files with strict errors: npx update-strict-comments // 4. (Optional) Add to build: // package.json scripts: // "typecheck": "tsc && tsc-strict" // Then run: npm run typecheck // 5. Strict files: files without //@ts-strict-ignore will be checked strictly. // Add //@ts-strict-ignore at top of files to opt out.
Debug
Known issues
breakingv2 changes semantics: files are now strict by default, and you opt out with //@ts-strict-ignore (not opt in with //@ts-strict). Running update-strict-comments is required for migration.
fix
Run `npx update-strict-comments` to add ignore comments to files with errors.
affects: >=2.0.0
gotchaTypeScript Language Service plugins only work in IDE (editor), not during compilation. Use `tsc-strict` CLI to catch strict errors in CI/build.
fix
Add `tsc-strict` to your build scripts: `"typecheck": "tsc && tsc-strict"`.
affects: >=1.0.0
gotchaDo not set `strict: true` in tsconfig when using this plugin; keep `strict: false` and control strictness via plugin configuration.
fix
Set `"strict": false` in compilerOptions and configure strict paths in plugin options.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'tsc-strict'
Trying to import plugin as a JavaScript module instead of configuring in tsconfig.
fix
Do not import in code. Configure in tsconfig.json under compilerOptions.plugins.
error TS2322: Type 'X' is not assignable to type 'Y'
Strict errors appear only in files without `//@ts-strict-ignore` comment.
fix
Add `//@ts-strict-ignore` at the top of the file to opt out of strict checking, or fix the type errors.
Unknown compiler option 'tsc-strict'.
Trying to pass 'tsc-strict' as a tsc flag instead of using the CLI or plugin.
fix
Use the CLI: `npx tsc-strict` or add plugin to tsconfig.
Upgrade
Version history
2.4.5latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency — requires TypeScript Language Service and tsc for compilation/type-checking
Agent activity
4 hits · last 30 days
node
4
Resources
tsc-strict — npm install tsc-strict · libregistry