1

Objective: Use TSLint to lint any TS files in the project done using VS 2015

I set up a gulp task as follows (from Setup TSLint in Visual Studio 2015):

//The actual task to run
gulp.task("TSLint:All", function () {
    return gulp.src(TYPE_SCRIPT_FILES)
        .pipe(plumber())
        .pipe(tslint())
        .pipe(tslint.report(
            "verbose", {
                emitError: false,
                reportLimit: 50
            }));
});

Things were working fine. Now I want to use the tslint-eslint-rules rules for linting.

I do the following

  1. Install the eslint-eslint-rules package as shown on https://github.com/buzinas/tslint-eslint-rules

  1. Create file called tslint.json as shown below

{
  "rulesDirectory": "node_modules/tslint-eslint-rules/dist/rules",
  "rules": {
    "no-constant-condition": true
  }
}

  1. Change my Gulp task as follows

gulp.task("TSLint:All", function () {
    return gulp.src(TYPE_SCRIPT_FILES)
        .pipe(plumber())
        .pipe(tslint({
            configuration: "tslint.json"
        }
        ))
        .pipe(tslint.report(
            "verbose", {
                emitError: false,
                reportLimit: 50
            }));
});

I start getting the following error (I believe for every error flagged by Linter): Plumber found unhandled error: SyntaxError: Unexpected token

How can I correct this ?

Community
  • 1
  • 1
antiskidwarpdrive
  • 321
  • 1
  • 2
  • 8

0 Answers0