Skip to content

Commit 1873f2d

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular-devkit/build-angular): add tslint as an optional peer dependency
tslint is currently used by the tslint builder within this package but is not represented in the dependencies. The can lead to accidental version mismatches as well as package manager hoisting problems due to the package manager not knowing the full dependency set of the package.
1 parent 7fed4cf commit 1873f2d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/angular_devkit/build_angular/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"karma": "^5.2.0",
8585
"ng-packagr": "^10.0.0",
8686
"protractor": "^7.0.0",
87+
"tslint": "^6.1.0",
8788
"typescript": ">=3.9 < 4.1"
8889
},
8990
"peerDependenciesMeta": {
@@ -98,6 +99,9 @@
9899
},
99100
"protractor": {
100101
"optional": true
102+
},
103+
"tslint": {
104+
"optional": true
101105
}
102106
}
103107
}

packages/angular_devkit/build_angular/src/tslint/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { readFileSync } from 'fs';
1111
import * as glob from 'glob';
1212
import { Minimatch } from 'minimatch';
1313
import * as path from 'path';
14-
import * as tslint from 'tslint'; // tslint:disable-line:no-implicit-dependencies
14+
import * as tslint from 'tslint';
1515
import { Program } from 'typescript';
1616
import { stripBom } from '../utils/strip-bom';
1717
import { Schema as RealTslintBuilderOptions } from './schema';
@@ -25,7 +25,7 @@ interface LintResult extends tslint.LintResult {
2525
async function _loadTslint() {
2626
let tslint;
2727
try {
28-
tslint = await import('tslint'); // tslint:disable-line:no-implicit-dependencies
28+
tslint = await import('tslint');
2929
} catch {
3030
throw new Error('Unable to find TSLint. Ensure TSLint is installed.');
3131
}

0 commit comments

Comments
 (0)