mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-18 11:44:05 +08:00
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.
This commit is contained in:
parent
7fed4cf7f7
commit
1873f2d28f
@ -84,6 +84,7 @@
|
|||||||
"karma": "^5.2.0",
|
"karma": "^5.2.0",
|
||||||
"ng-packagr": "^10.0.0",
|
"ng-packagr": "^10.0.0",
|
||||||
"protractor": "^7.0.0",
|
"protractor": "^7.0.0",
|
||||||
|
"tslint": "^6.1.0",
|
||||||
"typescript": ">=3.9 < 4.1"
|
"typescript": ">=3.9 < 4.1"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
@ -98,6 +99,9 @@
|
|||||||
},
|
},
|
||||||
"protractor": {
|
"protractor": {
|
||||||
"optional": true
|
"optional": true
|
||||||
|
},
|
||||||
|
"tslint": {
|
||||||
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import { readFileSync } from 'fs';
|
|||||||
import * as glob from 'glob';
|
import * as glob from 'glob';
|
||||||
import { Minimatch } from 'minimatch';
|
import { Minimatch } from 'minimatch';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as tslint from 'tslint'; // tslint:disable-line:no-implicit-dependencies
|
import * as tslint from 'tslint';
|
||||||
import { Program } from 'typescript';
|
import { Program } from 'typescript';
|
||||||
import { stripBom } from '../utils/strip-bom';
|
import { stripBom } from '../utils/strip-bom';
|
||||||
import { Schema as RealTslintBuilderOptions } from './schema';
|
import { Schema as RealTslintBuilderOptions } from './schema';
|
||||||
@ -25,7 +25,7 @@ interface LintResult extends tslint.LintResult {
|
|||||||
async function _loadTslint() {
|
async function _loadTslint() {
|
||||||
let tslint;
|
let tslint;
|
||||||
try {
|
try {
|
||||||
tslint = await import('tslint'); // tslint:disable-line:no-implicit-dependencies
|
tslint = await import('tslint');
|
||||||
} catch {
|
} catch {
|
||||||
throw new Error('Unable to find TSLint. Ensure TSLint is installed.');
|
throw new Error('Unable to find TSLint. Ensure TSLint is installed.');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user