mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 11:03:53 +08:00
fix(@schematics/angular): remove lint
target from minimal projects
Minimal projects are considered as throw-away projects and only a small subset of features are supported. More context #13408 and #13354 Closes #14727
This commit is contained in:
parent
8f3cacaff6
commit
fce849c7d6
@ -261,7 +261,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, appDir: string): Rul
|
||||
scripts: [],
|
||||
},
|
||||
},
|
||||
lint: {
|
||||
lint: options.minimal ? undefined : {
|
||||
builder: Builders.TsLint,
|
||||
options: {
|
||||
tsConfig: [
|
||||
|
@ -174,7 +174,7 @@ describe('Application Schematic', () => {
|
||||
expect(karmaConf).toContain(`dir: require('path').join(__dirname, '../../coverage/foo')`);
|
||||
});
|
||||
|
||||
it('minimal=true should not create e2e and test targets', async () => {
|
||||
it('minimal=true should not create e2e, lint and test targets', async () => {
|
||||
const options = { ...defaultOptions, minimal: true };
|
||||
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
|
||||
.toPromise();
|
||||
@ -182,6 +182,7 @@ describe('Application Schematic', () => {
|
||||
const architect = config.projects.foo.architect;
|
||||
expect(architect.test).not.toBeDefined();
|
||||
expect(architect.e2e).not.toBeDefined();
|
||||
expect(architect.e2e).not.toBeDefined();
|
||||
});
|
||||
|
||||
it('should create correct files when using minimal', async () => {
|
||||
@ -271,6 +272,18 @@ describe('Application Schematic', () => {
|
||||
const packageJson = JSON.parse(tree.readContent('package.json'));
|
||||
expect(packageJson.devDependencies['@angular-devkit/build-angular']).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should set the lint tsConfig option', async () => {
|
||||
const tree = await schematicRunner.runSchematicAsync('application', defaultOptions, workspaceTree)
|
||||
.toPromise();
|
||||
const workspace = JSON.parse(tree.readContent('/angular.json'));
|
||||
const lintOptions = workspace.projects.foo.architect.lint.options;
|
||||
expect(lintOptions.tsConfig).toEqual([
|
||||
'projects/foo/tsconfig.app.json',
|
||||
'projects/foo/tsconfig.spec.json',
|
||||
'projects/foo/e2e/tsconfig.json',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('custom projectRoot', () => {
|
||||
|
@ -98,17 +98,5 @@ describe('Application Schematic', () => {
|
||||
expect(e2eOptions.protractorConfig).toEqual('projects/foo/e2e/protractor.conf.js');
|
||||
expect(e2eOptions.devServerTarget).toEqual('foo:serve');
|
||||
});
|
||||
|
||||
it('should set the lint options', async () => {
|
||||
const tree = await schematicRunner.runSchematicAsync('e2e', defaultOptions, applicationTree)
|
||||
.toPromise();
|
||||
const workspace = JSON.parse(tree.readContent('/angular.json'));
|
||||
const lintOptions = workspace.projects.foo.architect.lint.options;
|
||||
expect(lintOptions.tsConfig).toEqual([
|
||||
'projects/foo/tsconfig.app.json',
|
||||
'projects/foo/tsconfig.spec.json',
|
||||
'projects/foo/e2e/tsconfig.json',
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user