Skip to content

Commit

Permalink
feat(@angular-devkit/build-angular): support TSLint 6.0+
Browse files Browse the repository at this point in the history
TSLint [6.0.0-beta0](https://github.com/palantir/tslint/releases/tag/6.0.0-beta0) was released, and `ng lint` throws with:

    TSLint must be version 5.5 or higher.

if we try to use it in a CLI project.

It looks like the current version check allows v5.5+ by checking that both the major and minor versions are > 5. So this fails with 6.0 (but would succeed with 6.5).
This fixes the check to allow using v6.0.
  • Loading branch information
cexbrayat authored and mgechev committed Jan 30, 2020
1 parent 7d8ebbd commit 25b4d93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/angular_devkit/build_angular/src/tslint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ async function _loadTslint() {
}

const version = tslint.Linter.VERSION && tslint.Linter.VERSION.split('.');
if (!version || version.length < 2 || Number(version[0]) < 5 || Number(version[1]) < 5) {
if (
!version || version.length < 2
|| (Number(version[0]) === 5 && Number(version[1]) < 5) // 5.5+
|| Number(version[0]) < 5 // 6.0+
) {
throw new Error('TSLint must be version 5.5 or higher.');
}

Expand Down

0 comments on commit 25b4d93

Please sign in to comment.