{"id":20625,"library":"tslint-loader","title":"tslint-loader","description":"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.","status":"maintenance","version":"3.5.4","language":"javascript","source_language":"en","source_url":"https://github.com/wbuchwalter/tslint-loader","tags":["javascript","tslint","typescript","webpack","loader","linting"],"install":[{"cmd":"npm install tslint-loader","lang":"bash","label":"npm"},{"cmd":"yarn add tslint-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add tslint-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for linting functionality","package":"tslint","optional":false}],"imports":[{"note":"This is a webpack loader, not a JavaScript import. It is referenced by name in webpack configuration.","wrong":"import tslintLoader from 'tslint-loader'","symbol":"tslint-loader","correct":"// In webpack config, use loader string 'tslint-loader'"}],"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.ts$/,\n        enforce: 'pre',\n        use: [\n          {\n            loader: 'tslint-loader',\n            options: {\n              configFile: 'tslint.json',\n              emitErrors: true,\n              failOnHint: true,\n              typeCheck: true,\n              tsConfigFile: 'tsconfig.json'\n            }\n          }\n        ]\n      }\n    ]\n  }\n}","lang":"javascript","description":"Configures tslint-loader as a pre-loader in webpack to lint all .ts files before compilation, with options for type checking and error handling."},"warnings":[{"fix":"Use eslint-loader with @typescript-eslint/parser and @typescript-eslint/eslint-plugin.","message":"TSLint is deprecated in favor of ESLint with TypeScript. Consider migrating to eslint-loader or @typescript-eslint.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Update TSLint to version 4.0.0 or higher.","message":"Requires TSLint >=4.0.0, not compatible with TSLint 3.x.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Set enforce: 'pre' in the rule configuration.","message":"The loader must be applied as a pre-loader using 'enforce: pre' to ensure it runs before compilation.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use appropriate configuration syntax for your webpack version.","message":"Webpack 1 uses 'preLoaders' and 'tslint' config property, while webpack 2+ uses 'rules'.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Ensure tsconfig.json exists and contains necessary compiler options.","message":"Setting 'typeCheck: true' requires a valid tsconfig.json file and may slow down compilation.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'-4':42 '1':41 '2019':13 '3.5.4':9 '4.0.0':46 'activ':71 'add':50 'build':18,67 'check':32 'compat':38 'compil':25 'config':28 'custom':27 'deprec':76 'differenti':48 'due':73 'emit':63 'error':64 'eslint':80 'fail':66 'favor':78 'file':23,29,36 'formatt':34 'hint':69 'integr':14 'javascript':83 'key':47 'last':10 'less':70 'lint':21,51,88 'loader':3,5,56,87 'option':61 'output':37 'pipelin':19 'pre':55 'pre-load':54 'requir':44 'rule':33 'seamless':49 'step':57 'support':26 'tslint':2,7,15,45,75,84 'tslint-load':1 'type':31 'type-check':30 'typescript':22,82,85 'updat':11 'version':8 'webpack':4,17,40,59,86","created_at":"2026-04-25T11:24:07.183760+00:00","updated_at":"2026-04-25T11:24:07.183760+00:00","problems":[{"fix":"Use webpack 3 or lower, or switch to eslint-loader.","cause":"Incompatibility with webpack 4+ due to deprecated API.","error":"Module build failed: TypeError: loader.runAsChild is not a function"},{"fix":"Run 'npm install --save-dev tslint tslint-loader'.","cause":"tslint-loader not installed or not in node_modules.","error":"Error: Could not load tslint-loader: The loader name is not recognized."},{"fix":"Set configFile to a string like 'tslint.json' or false.","cause":"configFile option expects a string path, but received another type.","error":"TypeError: configFile is not a string"},{"fix":"Run 'npm install --save-dev tslint'.","cause":"Missing peer dependency tslint.","error":"Error: Cannot find module 'tslint'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/wbuchwalter/tslint-loader","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/tslint-loader","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}