{"id":13275,"library":"gulp-tslint","title":"Gulp TSLint Plugin","description":"gulp-tslint is a Gulp plugin that integrates the TSLint static analysis tool into a Gulp build pipeline for TypeScript projects. It allows developers to lint TypeScript files as part of their Gulp tasks, applying TSLint's rules and custom formatters to report issues. The current stable version is 8.1.4. A critical point for users to understand is its dependency on TSLint, which has officially been deprecated by its maintainers in favor of ESLint. Consequently, `gulp-tslint` is effectively in an abandoned state, as its upstream linter is no longer maintained. Users should be aware that new TSLint rules or features will not be added, and future TypeScript language features may not be fully supported. The plugin offers various output formatters and options to control error reporting behavior, such as preventing Gulp from exiting on lint failures, and supports custom TSLint configurations.","status":"abandoned","version":"8.1.4","language":"javascript","source_language":"en","source_url":"https://github.com/panuhorsmalahti/gulp-tslint","tags":["javascript","gulp","typescript","plugin","ts","gulpplugin","gulpfriendly","tslint","linter"],"install":[{"cmd":"npm install gulp-tslint","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-tslint","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-tslint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for linting TypeScript files; gulp-tslint is a wrapper that utilizes tslint's core functionality.","package":"tslint","optional":false},{"reason":"TSLint requires a compatible version of TypeScript to parse files.","package":"typescript","optional":false}],"imports":[{"note":"The primary plugin function is exported as the default export.","wrong":"import { tslint } from 'gulp-tslint';","symbol":"tslint","correct":"import tslint from 'gulp-tslint';"},{"note":"The `report` function is a property of the default `tslint` export, not a separate named export.","wrong":"import { report } from 'gulp-tslint';","symbol":"tslint.report","correct":"import tslint from 'gulp-tslint';\n// ... pipe(tslint.report())"},{"note":"Standard CommonJS import for Node.js environments. Follows the same access pattern for `tslint.report`.","symbol":"tslint (CommonJS)","correct":"const tslint = require('gulp-tslint');"}],"quickstart":{"code":"import gulp from 'gulp';\nimport tslint from 'gulp-tslint';\nimport * as path from 'path';\n\n// IMPORTANT: Ensure you have a 'tslint.json' file in your project root\n// or provide configuration via the `tslint()` options.\n// Example 'tslint.json' for basic rules:\n// {\n//   \"rules\": {\n//     \"no-console\": true,\n//     \"class-name\": true,\n//     \"curly\": true\n//   }\n// }\n\ngulp.task('lint-ts', () =>\n    gulp.src(path.join(__dirname, 'src/**/*.ts')) // Adjust this path to your TypeScript source files\n        .pipe(tslint({\n            // Optionally, specify configuration directly or a path to a custom config file:\n            // configuration: {\n            //   rules: {\n            //     \"no-console\": true\n            //   }\n            // },\n            // configuration: 'config/my-tslint-rules.json',\n            formatter: 'stylish' // 'stylish' offers a readable output; other options exist (e.g., 'verbose')\n        }))\n        .pipe(tslint.report({\n            emitError: true, // Set to 'false' to prevent Gulp from halting on lint failures\n            summarizeFailureOutput: true // Provides a concise summary in the console on failure\n        }))\n);\n\ngulp.task('default', gulp.series('lint-ts'));","lang":"typescript","description":"This quickstart demonstrates how to set up a Gulp task to lint TypeScript files using `gulp-tslint`, applying a 'stylish' formatter and configuring error reporting behavior. It assumes a `tslint.json` file is present or configuration is provided inline."},"warnings":[{"fix":"Consider migrating your TypeScript projects to use ESLint with its TypeScript plugin (`@typescript-eslint/eslint-plugin`) and integrating it with Gulp via `gulp-eslint` or a similar plugin.","message":"TSLint, the underlying linter for `gulp-tslint`, has been officially deprecated by its maintainers in favor of ESLint. This means `gulp-tslint` will not receive updates for new TypeScript features or linting rules, and its long-term viability is severely limited.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Remove any `reporter` options from `tslint.report()` and instead specify the desired `formatter` (e.g., 'verbose', 'stylish') within the `tslint()` options object.","message":"As of `gulp-tslint` v6.0.0, the `reporter` option in `.report()` calls has been removed. All formatting and reporting should now be handled via the `formatter` option directly within the `tslint()` call.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Ensure a `tslint.json` file is present in your project root or an ancestor directory, or provide the `configuration` option with a path to a TSLint config file or an inline configuration object.","message":"A `tslint.json` configuration file is mandatory. If not found in a parent directory of the input file, or explicitly provided via the `configuration` option, `gulp-tslint` will likely fail to lint or apply desired rules.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"To prevent Gulp from stopping on lint errors, set the `emitError` option to `false` in the `tslint.report()` call: `.pipe(tslint.report({ emitError: false }))`.","message":"By default, `gulp-tslint` will emit a `PluginError` and halt the Gulp task if any linting failures are found.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install the required peer dependencies using `npm install --save-dev tslint typescript`.","message":"`tslint` (>=5.0.0-dev) and `typescript` (>=2) are peer dependencies and must be installed separately in your project alongside `gulp-tslint`. Failure to install them will result in runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Review the linting errors reported in the console and fix the code, or set `emitError: false` in `tslint.report()` to allow the Gulp task to complete despite linting failures.","cause":"TSLint found one or more errors in the specified file, and the `emitError` option in `tslint.report()` is either `true` or unset (default `true`), causing Gulp to halt.","error":"Error in plugin 'gulp-tslint': Failed to lint: <filename>"},{"fix":"Run `npm install --save-dev tslint` to install the required peer dependency.","cause":"The `tslint` peer dependency has not been installed in your project.","error":"Error: Cannot find module 'tslint'"},{"fix":"Create a `tslint.json` file in your project root, or specify the `configuration` option with a path to your config file or an inline configuration object in the `gulp-tslint` options.","cause":"`gulp-tslint` could not find a `tslint.json` configuration file in the project or ancestor directories, and no explicit `configuration` option was provided.","error":"Error: ENOENT: no such file or directory, open '<path>/tslint.json'"},{"fix":"Ensure you are using `import tslint from 'gulp-tslint';` and then calling `tslint.report()` as a method of the imported `tslint` object.","cause":"You are likely trying to import `report` as a named export (e.g., `import { report } from 'gulp-tslint';`) instead of accessing it as a property of the default export.","error":"TypeError: tslint.report is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}