Registry / testing / tslint-loader

tslint-loader

JSON →
library3.5.4jsnpmunverified

Webpack loader for TSLint, version 3.5.4, last updated in 2019. Integrates TSLint into webpack build pipeline to lint TypeScript files during compilation. Supports custom config files, type-checked rules, formatters, and file output. Compatible with webpack 1-4, but requires TSLint >=4.0.0. Key differentiator: seamlessly adds linting as a pre-loader step in webpack, with options to emit errors or fail builds on hints. Less active now due to TSLint deprecation in favor of ESLint with TypeScript.

npm install tslint-loader
INSTALL
IMPORT
SIG · TSLINT-LOADER
T
tslint-loader
testingjavascriptv3.5.4
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.

tslint-loader
// In webpack config, use loader string 'tslint-loader'
import tslintLoader from 'tslint-loader'
This is a webpack loader, not a JavaScript import. It is referenced by name in webpack configuration.

Configures tslint-loader as a pre-loader in webpack to lint all .ts files before compilation, with options for type checking and error handling.

// webpack.config.js module.exports = { module: { rules: [ { test: /\.ts$/, enforce: 'pre', use: [ { loader: 'tslint-loader', options: { configFile: 'tslint.json', emitErrors: true, failOnHint: true, typeCheck: true, tsConfigFile: 'tsconfig.json' } } ] } ] } }
Debug
Known issues
deprecatedTSLint is deprecated in favor of ESLint with TypeScript. Consider migrating to eslint-loader or @typescript-eslint.
fix
Use eslint-loader with @typescript-eslint/parser and @typescript-eslint/eslint-plugin.
affects: >=3.0.0
breakingRequires TSLint >=4.0.0, not compatible with TSLint 3.x.
fix
Update TSLint to version 4.0.0 or higher.
affects: >=3.0.0
gotchaThe loader must be applied as a pre-loader using 'enforce: pre' to ensure it runs before compilation.
fix
Set enforce: 'pre' in the rule configuration.
affects: >=2.0.0
gotchaWebpack 1 uses 'preLoaders' and 'tslint' config property, while webpack 2+ uses 'rules'.
fix
Use appropriate configuration syntax for your webpack version.
affects: >=3.0.0
gotchaSetting 'typeCheck: true' requires a valid tsconfig.json file and may slow down compilation.
fix
Ensure tsconfig.json exists and contains necessary compiler options.
affects: >=1.0.0
Errors
Common errors & fixes
Module build failed: TypeError: loader.runAsChild is not a function
Incompatibility with webpack 4+ due to deprecated API.
fix
Use webpack 3 or lower, or switch to eslint-loader.
Error: Could not load tslint-loader: The loader name is not recognized.
tslint-loader not installed or not in node_modules.
fix
Run 'npm install --save-dev tslint tslint-loader'.
TypeError: configFile is not a string
configFile option expects a string path, but received another type.
fix
Set configFile to a string like 'tslint.json' or false.
Error: Cannot find module 'tslint'
Missing peer dependency tslint.
fix
Run 'npm install --save-dev tslint'.
Upgrade
Version history
3.5.4latest on npm
Audit
Dependencies
tslintrequiredpeer dependency required for linting functionality
Agent activity
8 hits · last 30 days
node
8
Resources
tslint-loader — npm install tslint-loader · libregistry