Registry / testing / tslint-webpack-plugin

tslint-webpack-plugin

JSON →
library2.1.1jsnpmunverified

TSLint plugin for Webpack that lints all specified files, not only those imported by Webpack, making it useful for interface files missed due to tree-shaking. Version 2.1.1 is the latest stable release. The plugin is in maintenance mode due to TSLint being deprecated in favor of @typescript-eslint. Key differentiator vs tslint-loader: it lints all files matching a glob pattern instead of only files in the dependency graph.

npm install tslint-webpack-plugin
INSTALL
IMPORT
SIG · TSLINT-WEBPACK-PLU
T
tslint-webpack-plugin
testingjavascriptv2.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

TSLintPlugin
const TSLintPlugin = require('tslint-webpack-plugin');
import TSLintPlugin from 'tslint-webpack-plugin';
CommonJS required; no default ESM export
TSLintPlugin (ESM)
import TSLintPlugin = require('tslint-webpack-plugin');
import TSLintPlugin from 'tslint-webpack-plugin';
TypeScript import = require pattern for CJS modules
TSLintPlugin (type)
import TSLintPlugin = require('tslint-webpack-plugin');
import { TSLintPlugin } from 'tslint-webpack-plugin';
Default export, not named

Sets up Webpack with ts-loader and tslint-webpack-plugin to lint all .ts files in src/

const TSLintPlugin = require('tslint-webpack-plugin'); const path = require('path'); module.exports = { entry: './src/index.ts', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, resolve: { extensions: ['.ts', '.js'] }, module: { rules: [{ test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ }] }, plugins: [ new TSLintPlugin({ files: ['./src/**/*.ts'] }) ] };
Debug
Known issues
deprecatedTSLint is deprecated in favor of @typescript-eslint
fix
Migrate to @typescript-eslint/eslint-plugin and eslint-webpack-plugin or fork-ts-checker-webpack-plugin with ESLint
affects: >=0.0.0
breakingv2 removed the 'format' option for formatters
fix
Remove 'format' option; use custom formatter via TSLint API if needed
affects: >=2.0.0
gotchaPlugin does not fail the build by default; errors are warnings
fix
Set 'waitForLinting: true' and 'warningsAsError: true' to fail on lint errors
affects: >=0.0.0
gotchaRequires both tslint and webpack as peer dependencies; not automatically installed
fix
npm install tslint webpack --save-dev
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'tslint-webpack-plugin'
Missing npm install of the plugin
fix
npm install tslint-webpack-plugin --save-dev
TypeError: TSLintPlugin is not a constructor
Using ES import syntax (import TSLintPlugin from ...) which doesn't work with CJS module
fix
Replace with const TSLintPlugin = require('tslint-webpack-plugin');
Error: 'format' is not a supported option
Plugin v2+ removed the 'format' option
fix
Remove 'format' from plugin options
Upgrade
Version history
2.1.1latest on npm
Audit
Dependencies
tslintrequiredpeer dependency - core linting engine
webpackrequiredpeer dependency - plugin runs in Webpack
Agent activity
6 hits · last 30 days
node
6
Resources
tslint-webpack-plugin — npm install tslint-webpack-plugin · libregistry