Registry / type-stubs / eslint-plugin-tsc

eslint-plugin-tsc

JSON →
library2.0.0jsnpmunverified

ESLint plugin that wraps TypeScript compiler checks as an ESLint rule. Version 2.0.0 (September 2020) requires TypeScript 4+. It provides a single rule `tsc/config` that runs the TypeScript compiler on files linted by ESLint, reporting type errors and diagnostics. Unlike @typescript-eslint, which implements type-aware lint rules individually, this plugin directly invokes the full compiler, catching all type errors and compiler options like noUnusedLocals. Suitable for projects wanting to enforce compiler checks within ESLint without duplicating compiler options. Release cadence: infrequent, last release 2020.

npm install eslint-plugin-tsc
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-TSC
E
eslint-plugin-tsc
type-stubsjavascriptv2.0.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.

plugin
module.exports = { plugins: ['tsc'] };
Add 'tsc' to plugins array in ESLint config, then use rule 'tsc/config'.
tsc/config
"tsc/config": ["warn", { "configFile": "./tsconfig.json" }]
"tsc/config": true
Rule requires options object with configFile path; severity can be 1 or 'warn'.
configFile
"tsc/config": [1, { "configFile": "/absolute/path/tsconfig.json" }]
Absolute path recommended to avoid resolution issues.

Configures eslint-plugin-tsc to run TypeScript compiler checks via the tsc/config rule, overriding compiler options.

// .eslintrc.js module.exports = { plugins: ['tsc'], rules: { 'tsc/config': [ 'warn', { configFile: './tsconfig.json', compilerOptions: { noUnusedLocals: true, strictNullChecks: true } } ] } }; // Run ESLint on a TypeScript file // eslint src/index.ts
Debug
Known issues
breakingVersion 2.0.0 requires TypeScript 4+. Downgrade to 1.x for TypeScript 3.x compatibility.
fix
Use eslint-plugin-tsc@1.2.0 if using TypeScript <4.
affects: >=2.0.0
gotchaThe configFile path is relative to the current working directory, not the ESLint config file. Use absolute paths to avoid confusion.
fix
Specify an absolute path for configFile, e.g., path.resolve(__dirname, 'tsconfig.json').
affects: >=1.0.0
gotchaPlugin only provides a single rule 'tsc/config'. It does not include individual rules like '@typescript-eslint/no-unused-vars'.
fix
Use alongside @typescript-eslint for fine-grained lint rules if needed.
affects: >=1.0.0
deprecatedPlugin is thinly maintained; last release 2020. Consider switching to @typescript-eslint which is more actively maintained and integrates type checking.
fix
Migrate to @typescript-eslint/parser and @typescript-eslint/eslint-plugin.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Could not find tsconfig.json. Please specify configFile in rule options.
configFile path is missing or incorrect.
fix
Add configFile to rule options with correct path, e.g., "configFile": "path/to/tsconfig.json".
Parsing error: The keyword 'import' is reserved
ESLint is parsing TypeScript as JavaScript. Need to configure TypeScript parser.
fix
Add @typescript-eslint/parser to your ESLint config: 'parser': '@typescript-eslint/parser'.
Definition for rule 'tsc/config' was not found.
eslint-plugin-tsc is not installed or not added to plugins array.
fix
Run npm install eslint-plugin-tsc --save-dev and add 'tsc' to plugins array.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency; plugin wraps TypeScript compiler
eslintrequiredPeer dependency; plugin runs as ESLint rule
Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources
eslint-plugin-tsc — npm install eslint-plugin-tsc · libregistry