Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Subtle bug in the severity rules when using nested tslint.json files #2476

Closed
jonaskello opened this issue Apr 2, 2017 · 3 comments · Fixed by #2516
Closed

Subtle bug in the severity rules when using nested tslint.json files #2476

jonaskello opened this issue Apr 2, 2017 · 3 comments · Fixed by #2516

Comments

@jonaskello
Copy link
Contributor

jonaskello commented Apr 2, 2017

Bug Report

  • TSLint version: 5.0.0
  • TypeScript version: 2.2.2
  • Running TSLint via: CLI

TypeScript code being linted

Minimal repro with failing travis build available here:

https://github.com/jonaskello/tslint-repro

Actual behavior

When I have nested tslint.json files the no-consecutive-blank-lines rule fails with this error:

Error: Severity for rule 'no-consecutive-blank-lines not found

See the travis build for full stack.

The same seems to happen with the whitespace and semicolon rules.

Expected behavior

To sucessfully lint without exceptions.

@jonaskello
Copy link
Contributor Author

Btw, I extracted this repro from a larger code base where I got the error. I managed to work around it now. With tslint4 our linting took about 17 seconds. Now with tslint5 it takes 7 seconds. Thank you for the performance boost 👍 🚀.

@huy-nguyen
Copy link

I'm having this problem as well. @jonaskello How did you work around this bug?

@jonaskello
Copy link
Contributor Author

jonaskello commented Apr 4, 2017

I temporarily removed the nested tslint.json file from the sub-tree. This way the rules from the parent tslint.json is applied to the code in the sub-tree. This gave me a bunch of error because the rules in the parent are not meant to be applied to the sub-tree (hence the nested tslint.json). However from these errors I filtered out only errors concerning no-consecutive-blank-lines, whitespace, and semicolon and fixed those in the sub-tree. Then I put the nested tslint.json back and it worked. Seems only those three rules are affected by this bug.

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

Successfully merging a pull request may close this issue.

3 participants