Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how ro call tslint with parameter using gulp-tslint ? #136

Open
sirentek opened this issue Aug 19, 2017 · 1 comment
Open

how ro call tslint with parameter using gulp-tslint ? #136

sirentek opened this issue Aug 19, 2017 · 1 comment

Comments

@sirentek
Copy link

sirentek commented Aug 19, 2017

gulp-tslint version: 8.1.2
tslint version: 5.6
Operating system: Windows10

Example gulpclass.ts task:


import * as tslint from 'gulp-tslint';
.....

  @Task()
  private analyseTypescript() {
    let options = { 
      summarizeFailureOutput: true 
    };

    return gulp.src(['./src/**/*.ts', '!**/*.d.ts', '!node_modules/**'])
      .pipe(tslint.default())
      .pipe(tslint.default.report(options));
  }

Console output:
Warning: The 'no-use-before-declare' rule requires type information.

adding type-check parameter in command line solves it:
tslint --type-check --project tslint.json
=>Warning goes away.

how could we add type-check parameter in gulp-tslint ?
I couldn't find a similar example..

Thanks!

@davehensley
Copy link

Usually the project configuration (--project) is tsconfig.json, whereas tslint.json is (obviously) the tslint configuration (--config).

Anyway, you just need to add another pipe:

.pipe(tslint({program: require("tslint").Linter.createProgram("./tsconfig.json")}))

Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants