File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
packages/schematics/angular/workspace Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 4242 "instance-method"
4343 ]
4444 }
45- ],
45+ ],<% if (strict) { %>
46+ "no-any": true,<% } %>
4647 "no-console": [
4748 true,
4849 "debug",
8283 "named": "never"
8384 }
8485 },
86+ "typedef": [true, "call-signature"],
8587 "typedef-whitespace": {
8688 "options": [
8789 {
Original file line number Diff line number Diff line change @@ -81,10 +81,22 @@ describe('Workspace Schematic', () => {
8181 expect(angularCompilerOptions).toBeUndefined();
8282 });
8383
84- it('should not add strict compiler options when true', async () => {
84+ it('should add strict compiler options when true', async () => {
8585 const tree = await schematicRunner.runSchematicAsync('workspace', { ...defaultOptions, strict: true }).toPromise();
8686 const { compilerOptions, angularCompilerOptions } = JSON.parse(tree.readContent('/tsconfig.base.json'));
8787 expect(compilerOptions.strict).toBe(true);
8888 expect(angularCompilerOptions.strictTemplates).toBe(true);
8989 });
90+
91+ it('should not add strict lint options when false', async () => {
92+ const tree = await schematicRunner.runSchematicAsync('workspace', { ...defaultOptions, strict: false }).toPromise();
93+ const { rules } = JSON.parse(tree.readContent('/tslint.json'));
94+ expect(rules['no-any']).toBeUndefined();
95+ });
96+
97+ it('should add strict lint options when true', async () => {
98+ const tree = await schematicRunner.runSchematicAsync('workspace', { ...defaultOptions, strict: true }).toPromise();
99+ const { rules } = JSON.parse(tree.readContent('/tslint.json'));
100+ expect(rules['no-any']).toBe(true);
101+ });
90102});
You can’t perform that action at this time.
0 commit comments