Ionic Gulp TSLint

raw JSON →
1.1.0 verified Fri May 01 auth: no javascript deprecated

A Gulp task wrapper for linting TypeScript files in Ionic projects using TSLint. This package (v1.1.0) simplifies integrating TSLint into an Ionic build pipeline. It exposes a single function accepting options for source globs, TSLint configuration, reporter type, and reporter options. The release cadence is low; no updates since 2016. Compared to using gulp-tslint directly, this package provides Ionic-specific defaults like 'app/**/*.ts', but is largely unnecessary as it tightly couples to an older Ionic toolchain. Note that TSLint itself is deprecated in favor of ESLint with TypeScript plugins, and this package has no active maintenance.

error TypeError: tslint is not a function
cause Importing using require('ionic-gulp-tslint').tslint instead of require('ionic-gulp-tslint').
fix
Use const tslint = require('ionic-gulp-tslint');
error Error: Cannot find module 'tslint'
cause Missing tslint dependency.
fix
Install tslint: npm install tslint --save-dev
error Error: Invalid reporter 'prose'
cause gulp-tslint does not support 'prose' reporter; it was removed.
fix
Use 'verbose', 'json', 'full', or 'msbuild'.
deprecated TSLint is deprecated in favor of ESLint with TypeScript support.
fix Migrate to ESLint with @typescript-eslint/parser and @typescript-eslint/eslint-plugin. Use community Gulp plugins like gulp-eslint.
breaking Package relies on deprecated gulp-tslint v4.x which has breaking changes in options structure compared to earlier versions.
fix Refer to gulp-tslint documentation: reporter property is a string, reportOptions object. Also ensure tslintOptions fields match expected.
breaking Default glob 'app/**/*.ts' may not match your project structure if files are elsewhere (e.g., src/).
fix Explicitly set the src option to match your TypeScript files.
gotcha The tslint option inside tslintOptions is not used; the Linter instance is controlled by gulp-tslint.
fix Omit the tslint option; it's ignored. Use configuration and rulesDirectory only.
npm install ionic-gulp-tslint
yarn add ionic-gulp-tslint
pnpm add ionic-gulp-tslint

Shows how to define a Gulp task that lints TypeScript files using the default tslint function with custom source and configuration.

const gulp = require('gulp');
const tslint = require('ionic-gulp-tslint');

gulp.task('lint', function () {
  return tslint({
    src: 'app/**/*.ts',
    tslintOptions: {
      configuration: 'tslint.json'
    },
    reporter: 'verbose',
    reportOptions: {
      emitError: true
    }
  });
});