File tree 2 files changed +16
-2
lines changed
packages/schematics/angular/workspace
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 42
42
"instance-method"
43
43
]
44
44
}
45
- ],
45
+ ],<% if (strict) { %>
46
+ "no-any": true,<% } %>
46
47
"no-console": [
47
48
true,
48
49
"debug",
82
83
"named": "never"
83
84
}
84
85
},
86
+ "typedef": [true, "call-signature"],
85
87
"typedef-whitespace": {
86
88
"options": [
87
89
{
Original file line number Diff line number Diff line change @@ -81,10 +81,22 @@ describe('Workspace Schematic', () => {
81
81
expect ( angularCompilerOptions ) . toBeUndefined ( ) ;
82
82
} ) ;
83
83
84
- it ( 'should not add strict compiler options when true' , async ( ) => {
84
+ it ( 'should add strict compiler options when true' , async ( ) => {
85
85
const tree = await schematicRunner . runSchematicAsync ( 'workspace' , { ...defaultOptions , strict : true } ) . toPromise ( ) ;
86
86
const { compilerOptions, angularCompilerOptions } = JSON . parse ( tree . readContent ( '/tsconfig.base.json' ) ) ;
87
87
expect ( compilerOptions . strict ) . toBe ( true ) ;
88
88
expect ( angularCompilerOptions . strictTemplates ) . toBe ( true ) ;
89
89
} ) ;
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
+ } ) ;
90
102
} ) ;
You can’t perform that action at this time.
0 commit comments