Registry / devops / tsconfig-lint

tsconfig-lint

JSON →
library0.12.0jsnpmunverified

A CLI and Node API to run TSLint on files listed in a tsconfig.json. Integrates with tsconfig-glob for filesGlob support. Active development up to v0.12.0, with a deprecation notice recommending migration to TypeScript 2.0's built-in 'include' glob support. Differentiator: automates linting of tsconfig-defined files, reducing manual file list maintenance. Uses a callback-based async API. Last release v0.12.0; no recent updates.

npm install tsconfig-lint
INSTALL
IMPORT
SIG · TSCONFIG-LINT
T
tsconfig-lint
devopsjavascriptv0.12.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 * as lint from 'tsconfig-lint'
import lint from 'tsconfig-lint'
tsconfig-lint exports a single function as a module, not a default export. Use namespace import.
lint function
const lint = require('tsconfig-lint')
const { lint } = require('tsconfig-lint')
In CJS, require returns the function directly; destructuring gives undefined.
type Options
import type { Options } from 'tsconfig-lint'
TypeScript users can import the Options interface for typing the config object.

Run tslint using tsconfig-lint with custom options including filesGlob.

import * as lint from 'tsconfig-lint'; import * as path from 'path'; const options = { configPath: '.', cwd: process.cwd(), useGlob: true, tsconfigOptions: { indent: 2 }, tsLintConfigFilePath: 'tslint.json' }; lint(options, (err: Error | null) => { if (err) { console.error('Linting failed:', err); process.exit(1); } console.log('Linting complete'); });
tsconfig-lint --version
Debug
Known issues
breakingIn v0.9.0, the --use-glob option now only uses filesGlob instead of files, and tsconfig-glob has been removed as a dependency.
fix
Update scripts using --use-glob to rely solely on filesGlob; no longer need tsconfig-glob installed.
affects: >=0.9.0
deprecatedThis package is deprecated in favor of TypeScript 2.0's 'include' property for glob support in tsconfig.json.
fix
Migrate to TypeScript 2.0+ and use the 'include' and 'exclude' properties in tsconfig.json; stop using tsconfig-lint.
affects: >=0.12.0
gotchaThe CJS require returns the function directly, not an object with a 'lint' property.
fix
Use `const lint = require('tsconfig-lint')` instead of destructured import.
affects: all
breakingIn v0.9.0, tsconfig-glob was removed as a dependency, so filesGlob expansion must be handled externally if needed.
fix
Install tsconfig-glob separately if you need filesGlob support, or use TypeScript's built-in glob patterns.
affects: >=0.9.0
Errors
Common errors & fixes
TypeError: lint is not a function
Importing the module incorrectly using named export instead of namespace import.
fix
Use `import * as lint from 'tsconfig-lint'` or `const lint = require('tsconfig-lint')`.
Cannot find module 'tsconfig-lint'
Package not installed in node_modules.
fix
Run `npm install tsconfig-lint --save-dev`.
Error: ENOENT: no such file or directory, open 'tsconfig.json'
The configPath option points to a directory without a tsconfig.json file.
fix
Ensure the configPath directory contains a tsconfig.json, or provide the full path to a .json file.
Upgrade
Version history
0.12.0latest on npm
Audit
Dependencies
tslintrequiredtsconfig-lint runs TSLint; must be installed separately
Agent activity
13 hits · last 30 days
node
12
Resources
tsconfig-lint — npm install tsconfig-lint · libregistry