Registry / testing / lint-staged-tsc

lint-staged-tsc

JSON →
library0.2.1jsnpmunverified

A utility that extends lint-staged to run TypeScript type checking only on staged files, improving performance by avoiding full project rechecks. Currently at stable v0.2.1 with intermittent releases (last in May 2022). The key differentiator is that unlike tsc --noEmit on all files, it scopes type checking to the staged files, respecting tsconfig include and declarations. Minimal dependencies but requires lint-staged as peer. Suitable for CI and pre-commit hooks.

npm install lint-staged-tsc
INSTALL
IMPORT
SIG · LINT-STAGED-TSC
L
lint-staged-tsc
testingjavascriptv0.2.1
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.

lint-staged-tsc
✓ // No import needed; configure in lint-staged config as a command string
✗ const lintStagedTsc = require('lint-staged-tsc')
This is a CLI tool invoked by lint-staged, not a library. Do not import in JavaScript code.

Configure lint-staged to run TypeScript type checking on staged .ts/.tsx files using lint-staged-tsc.

{ "lint-staged": { "**/*.{ts,tsx}": "lint-staged-tsc" } }
lint-staged-tsc --version
Debug
Known issues
gotchaThis tool requires TypeScript to be installed as a devDependency. It uses the local tsc binary.
fix
Ensure typescript is in devDependencies (npm i -D typescript).
affects: >=0.0.2
gotchaThe tool relies on the tsconfig.json include/exclude configuration. If your tsconfig doesn't cover staged files, type checking may be skipped.
fix
Verify that tsconfig.json includes the staged files. Adjust include patterns if needed.
affects: >=0.0.2
gotchaThis is not a replacement for full tsc --noEmit. It only checks staged files; errors in non-staged files will not be caught until they are staged.
fix
Consider running full type check in CI or periodically.
affects: >=0.0.2
deprecatedProject has seen no updates since May 2022. May not support newer TypeScript versions or lint-staged breaking changes.
fix
Monitor for updates or consider alternatives like tsc-files or custom lint-staged task.
affects: >=0.2.1
Errors
Common errors & fixes
Cannot find module 'lint-staged-tsc'
Package not installed or not in node_modules
fix
Run `npm install --save-dev lint-staged-tsc`
lint-staged-tsc: command not found
lint-staged may be running in a shell that doesn't have the node_modules/.bin in PATH
fix
Configure lint-staged to use npx: `"npx lint-staged-tsc"` or ensure package is installed locally.
Upgrade
Version history
0.2.1latest on npm
Audit
Dependencies
lint-stagedrequiredpeer dependency; the utility is designed to be run as a lint-staged task
Agent activity
4 hits · last 30 days
node
4
Resources