Registry / testing / tsc-lint-staged

tsc-lint-staged

JSON →
library0.2.0jsnpmunverified

A lightweight utility (v0.2.0) that integrates TypeScript compiler checking into lint-staged workflows. Unlike running `tsc --noEmit` on the whole project, it only checks staged files by leveraging the project's `tsconfig.json`. Release cadence is low/irregular. Key differentiators: no configuration overhead, respects tsconfig settings, avoids rechecking unchanged files, and works with any lint-staged setup.

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

default
import tscLintStaged from 'tsc-lint-staged'
const tscLintStaged = require('tsc-lint-staged')
Package is ESM-only since v0.2.0
maybe
import { maybe } from 'tsc-lint-staged'
const maybe = require('tsc-lint-staged').maybe
Named export for Optional type; only useful in TypeScript projects
TypeScript compiler function
import tscLintStaged from 'tsc-lint-staged'
import * as tscLintStaged from 'tsc-lint-staged'
Default export is the function; namespace import works but is unnecessary

Configures lint-staged to run tsc-lint-staged on staged .ts files, checking TypeScript compilation without emitting output.

// lint-staged.config.js export default { '*.ts': ['tsc-lint-staged'], };
Debug
Known issues
breakingPackage is ESM-only since v0.2.0; CommonJS projects must use dynamic import or update to ESM.
fix
Convert project to ESM or use a dynamic import: const tscLintStaged = await import('tsc-lint-staged');
affects: >=0.2.0
gotchaDoes not support monorepos with multiple tsconfig.json files; it uses the closest tsconfig.json to the staged file.
fix
Manually specify tsconfig path using environment variable TSC_LINT_STAGED_TSCONFIG_PATH if needed.
affects: <1.0.0
deprecatedThe `maybe` export is experimental and may be removed in future versions.
fix
Avoid relying on `maybe` for production code.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'tsc-lint-staged'
Package not installed or not found in node_modules
fix
Run `npm install --save-dev tsc-lint-staged` and ensure it is in devDependencies.
TypeError: tscLintStaged is not a function
Using CommonJS require on ESM-only package
fix
Use dynamic import: const tscLintStaged = (await import('tsc-lint-staged')).default;
error TS2307: Cannot find module 'tsc-lint-staged' or its corresponding type declarations.
TypeScript cannot resolve module types because package lacks type definitions
fix
Install @types/tsc-lint-staged or add a declaration file: declare module 'tsc-lint-staged';
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
typescriptrequiredpeer dependency required to run tsc
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
tsc-lint-staged — npm install tsc-lint-staged · libregistry