kratiahuja / broccoli-tslinter

Broccoli Plugin to run linter on typescript files. Uses tslint internally.
MIT License
9 stars 6 forks source link

Update to use tslint@4 and typescript@2. #8

Closed rwjblue closed 7 years ago

rwjblue commented 7 years ago

This likely will need to be a 2.0.0 release.

Additional reading:

rwjblue commented 7 years ago

Currently, broccoli-tslinter is emitting some errors/warnings when used in Glimmer (since Glimmer is using typescript@2). So I set about fixing that....

chadhietala commented 7 years ago

LGTM

rwjblue commented 7 years ago

Due to https://github.com/kratiahuja/broccoli-tslinter/issues/7 I figured I'd paste the output from a npm test run locally:


> broccoli-tslinter@1.0.0 test /Users/rjackson/src/open-source/broccoli-tslinter
> mocha tests/

  broccoli-tslinter

    ✓ providing non existent configuration file should result in error

    ✓ should throw error during parsing of configuration file

    ✓ should throw error when configuration file does not follow format
Using tslint.json as the default file for linting rules
Finished linting 1 successfully

    ✓ linting correct file should result in no lint errors (88ms)
Using tslint.json as the default file for linting rules

errorFile2.ts[5, 13]: Use of debugger statements is forbidden
errorFile2.ts[6, 13]: forbidden eval
errorFile2.ts[3, 5]: misplaced opening brace
errorFile2.ts[4, 36]: missing whitespace
errorFile2.ts[4, 12]: missing whitespace

======= Found 5 tslint errors in 2 files =======

    ✓ linting error files should result in lint errors
Using tslint.json as the default file for linting rules

errorFile2.ts[5, 13]: Use of debugger statements is forbidden
errorFile2.ts[6, 13]: forbidden eval
errorFile2.ts[3, 5]: misplaced opening brace
errorFile2.ts[4, 36]: missing whitespace
errorFile2.ts[4, 12]: missing whitespace

======= Found 5 tslint errors in 2 files =======
Finished linting 0 successfully

    ✓ linting errors should be the same on subsequent runs
Using tslint.json as the default file for linting rules

errorFile2.ts[5, 13]: Use of debugger statements is forbidden
errorFile2.ts[6, 13]: forbidden eval
errorFile2.ts[3, 5]: misplaced opening brace
errorFile2.ts[4, 36]: missing whitespace
errorFile2.ts[4, 12]: missing whitespace

======= Found 5 tslint errors in 2 files =======

    ✓ tests should be generated if files result in lint error
Using tslint.json as the default file for linting rules

errorFile2.ts[5, 13]: Use of debugger statements is forbidden
errorFile2.ts[6, 13]: forbidden eval
errorFile2.ts[3, 5]: misplaced opening brace
errorFile2.ts[4, 36]: missing whitespace
errorFile2.ts[4, 12]: missing whitespace

======= Found 5 tslint errors in 2 files =======

    ✓ tests should not be generated when disableTestGenerator is true
Using tslint.json as the default file for linting rules

errorFile2.ts[5, 13]: Use of debugger statements is forbidden
errorFile2.ts[6, 13]: forbidden eval
errorFile2.ts[3, 5]: misplaced opening brace
errorFile2.ts[4, 36]: missing whitespace
errorFile2.ts[4, 12]: missing whitespace

======= Found 5 tslint errors in 2 files =======

    ✓ tests should be generated when disableTestGenerator is false
Using tslint.json as the default file for linting rules

errorFile2.ts[5, 13]: Use of debugger statements is forbidden
errorFile2.ts[6, 13]: forbidden eval
errorFile2.ts[3, 5]: misplaced opening brace
errorFile2.ts[4, 36]: missing whitespace
errorFile2.ts[4, 12]: missing whitespace

======= Found 5 tslint errors in 2 files =======

    ✓ custom test generator function is set

errorFile2.ts[5, 13]: Use of debugger statements is forbidden
errorFile2.ts[6, 13]: forbidden eval
errorFile2.ts[3, 5]: misplaced opening brace
errorFile2.ts[4, 36]: missing whitespace
errorFile2.ts[4, 12]: missing whitespace

======= Found 5 tslint errors in 2 files =======

    ✓ providing custom configuration file should lint files
Using tslint.json as the default file for linting rules
Lint output written to file: tests/fixtures/output.txt

    ✓ should lint output to a file if output file is provided
Using tslint.json as the default file for linting rules

errorFile2.ts[5, 13]: Use of debugger statements is forbidden
errorFile2.ts[6, 13]: forbidden eval
errorFile2.ts[3, 5]: misplaced opening brace
errorFile2.ts[4, 36]: missing whitespace
errorFile2.ts[4, 12]: missing whitespace

======= Found 5 tslint errors in 2 files =======

    ✓ should throw an error when failBuild option is passed for error files
Using tslint.json as the default file for linting rules
Finished linting 1 successfully

    ✓ should not throw an error when failBuild option is passed for correct files

  14 passing (219ms)
kratiahuja commented 7 years ago

@rwjblue Thanks for the PR. LGTM. I added you as a collabrator as well. I'll push a release tonight.

kratiahuja commented 7 years ago

@rwjblue Thanks for PR once again! broccoli-tslinter@2.0.0 is released.