{"id":20628,"library":"tslint-webpack-plugin","title":"tslint-webpack-plugin","description":"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.","status":"maintenance","version":"2.1.1","language":"javascript","source_language":"en","source_url":"https://jrparish@github.com/jrparish/tslint-webpack-plugin","tags":["javascript","webpack","tslint","typescript","plugin","linting"],"install":[{"cmd":"npm install tslint-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add tslint-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add tslint-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - core linting engine","package":"tslint","optional":false},{"reason":"peer dependency - plugin runs in Webpack","package":"webpack","optional":false}],"imports":[{"note":"CommonJS required; no default ESM export","wrong":"import TSLintPlugin from 'tslint-webpack-plugin';","symbol":"TSLintPlugin","correct":"const TSLintPlugin = require('tslint-webpack-plugin');"},{"note":"TypeScript import = require pattern for CJS modules","wrong":"import TSLintPlugin from 'tslint-webpack-plugin';","symbol":"TSLintPlugin (ESM)","correct":"import TSLintPlugin = require('tslint-webpack-plugin');"},{"note":"Default export, not named","wrong":"import { TSLintPlugin } from 'tslint-webpack-plugin';","symbol":"TSLintPlugin (type)","correct":"import TSLintPlugin = require('tslint-webpack-plugin');"}],"quickstart":{"code":"const TSLintPlugin = require('tslint-webpack-plugin');\nconst path = require('path');\nmodule.exports = {\n  entry: './src/index.ts',\n  output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' },\n  resolve: { extensions: ['.ts', '.js'] },\n  module: { rules: [{ test: /\\.ts$/, use: 'ts-loader', exclude: /node_modules/ }] },\n  plugins: [\n    new TSLintPlugin({ files: ['./src/**/*.ts'] })\n  ]\n};","lang":"javascript","description":"Sets up Webpack with ts-loader and tslint-webpack-plugin to lint all .ts files in src/"},"warnings":[{"fix":"Migrate to @typescript-eslint/eslint-plugin and eslint-webpack-plugin or fork-ts-checker-webpack-plugin with ESLint","message":"TSLint is deprecated in favor of @typescript-eslint","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Remove 'format' option; use custom formatter via TSLint API if needed","message":"v2 removed the 'format' option for formatters","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Set 'waitForLinting: true' and 'warningsAsError: true' to fail on lint errors","message":"Plugin does not fail the build by default; errors are warnings","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"npm install tslint webpack --save-dev","message":"Requires both tslint and webpack as peer dependencies; not automatically installed","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install tslint-webpack-plugin --save-dev","cause":"Missing npm install of the plugin","error":"Error: Cannot find module 'tslint-webpack-plugin'"},{"fix":"Replace with const TSLintPlugin = require('tslint-webpack-plugin');","cause":"Using ES import syntax (import TSLintPlugin from ...) which doesn't work with CJS module","error":"TypeError: TSLintPlugin is not a constructor"},{"fix":"Remove 'format' from plugin options","cause":"Plugin v2+ removed the 'format' option","error":"Error: 'format' is not a supported option"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}