Skip to content

Commit a0b477f

Browse files
committed
feat(@angular/cli): extend tslnit config from recommended
no need to duplicate rules new rules can be applied without updating, when new tslint is used Fixes: #6179
1 parent 01cbf65 commit a0b477f

File tree

5 files changed

+26
-75
lines changed

5 files changed

+26
-75
lines changed

packages/@angular/cli/blueprints/ng/files/__path__/polyfills.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* BROWSER POLYFILLS
1919
*/
2020

21-
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
21+
/** IE9, IE10 and IE11 requires all of the following polyfills. */
2222
// import 'core-js/es6/symbol';
2323
// import 'core-js/es6/object';
2424
// import 'core-js/es6/function';
@@ -37,26 +37,24 @@
3737
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
3838
// import 'classlist.js'; // Run `npm install --save classlist.js`.
3939

40-
/** Evergreen browsers require these. **/
40+
/** Evergreen browsers require these. */
4141
import 'core-js/es6/reflect';
4242
import 'core-js/es7/reflect';
4343

4444

4545
/**
4646
* Required to support Web Animations `@angular/animation`.
4747
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
48-
**/
48+
*/
4949
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
5050

5151

52-
5352
/***************************************************************************************************
5453
* Zone JS is required by Angular itself.
5554
*/
5655
import 'zone.js/dist/zone'; // Included with Angular CLI.
5756

5857

59-
6058
/***************************************************************************************************
6159
* APPLICATION IMPORTS
6260
*/

packages/@angular/cli/blueprints/ng/files/__path__/test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare const __karma__: any;
1717
declare const require: any;
1818

1919
// Prevent Karma from running prematurely.
20-
__karma__.loaded = function () {};
20+
__karma__.loaded = () => { };
2121

2222
// First, initialize the Angular testing environment.
2323
getTestBed().initTestEnvironment(
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,16 @@
11
{
2-
"rulesDirectory": [
3-
"node_modules/codelyzer"
2+
"extends": [
3+
"tslint:recommended"
44
],
55
"rules": {
6-
"arrow-return-shorthand": true,
7-
"callable-types": true,
8-
"class-name": true,
9-
"comment-format": [
10-
true,
11-
"check-space"
12-
],
13-
"curly": true,
14-
"eofline": true,
15-
"forin": true,
166
"import-blacklist": [
177
true,
188
"rxjs"
199
],
20-
"import-spacing": true,
21-
"indent": [
10+
"interface-name": [
2211
true,
23-
"spaces"
12+
"never-prefix"
2413
],
25-
"interface-over-type-literal": true,
26-
"label-position": true,
2714
"max-line-length": [
2815
true,
2916
140
@@ -34,8 +21,6 @@
3421
"static-before-instance",
3522
"variables-before-functions"
3623
],
37-
"no-arg": true,
38-
"no-bitwise": true,
3924
"no-console": [
4025
true,
4126
"debug",
@@ -44,69 +29,36 @@
4429
"timeEnd",
4530
"trace"
4631
],
47-
"no-construct": true,
48-
"no-debugger": true,
49-
"no-duplicate-super": true,
32+
"no-consecutive-blank-lines": [
33+
true,
34+
2
35+
],
5036
"no-empty": false,
51-
"no-empty-interface": true,
52-
"no-eval": true,
5337
"no-inferrable-types": [
5438
true,
5539
"ignore-params"
5640
],
57-
"no-misused-new": true,
5841
"no-non-null-assertion": true,
59-
"no-shadowed-variable": true,
6042
"no-string-literal": false,
61-
"no-string-throw": true,
6243
"no-switch-case-fall-through": true,
63-
"no-trailing-whitespace": true,
64-
"no-unnecessary-initializer": true,
65-
"no-unused-expression": true,
44+
"no-trailing-whitespace": [
45+
true,
46+
"ignore-template-strings"
47+
],
6648
"no-use-before-declare": true,
67-
"no-var-keyword": true,
6849
"object-literal-sort-keys": false,
69-
"one-line": [
70-
true,
71-
"check-open-brace",
72-
"check-catch",
73-
"check-else",
74-
"check-whitespace"
50+
"ordered-imports": [
51+
false
7552
],
76-
"prefer-const": true,
7753
"quotemark": [
7854
true,
79-
"single"
55+
"single",
56+
"avoid-escape"
8057
],
81-
"radix": true,
82-
"semicolon": [
83-
"always"
58+
"trailing-comma": [
59+
false
8460
],
85-
"triple-equals": [
86-
true,
87-
"allow-null-check"
88-
],
89-
"typedef-whitespace": [
90-
true,
91-
{
92-
"call-signature": "nospace",
93-
"index-signature": "nospace",
94-
"parameter": "nospace",
95-
"property-declaration": "nospace",
96-
"variable-declaration": "nospace"
97-
}
98-
],
99-
"typeof-compare": true,
100-
"unified-signatures": true,
10161
"variable-name": false,
102-
"whitespace": [
103-
true,
104-
"check-branch",
105-
"check-decl",
106-
"check-operator",
107-
"check-separator",
108-
"check-type"
109-
],
11062
"directive-selector": [
11163
true,
11264
"attribute",
@@ -131,5 +83,8 @@
13183
"no-access-missing-member": true,
13284
"templates-use-public": true,
13385
"invoke-injectable": true
134-
}
86+
},
87+
"rulesDirectory": [
88+
"node_modules/codelyzer"
89+
]
13590
}

tests/e2e/tests/lint/lint-with-type-check-fail.ts

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ function check(val: any, fxState: any) {
3636
fxState.num = val + "";
3737
}
3838
}
39-
4039
`;
4140

4241
return Promise.resolve()

tests/e2e/tests/lint/lint-with-type-check.ts

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ function check(val: any, fxState: any) {
3535
fxState.num = val + "";
3636
}
3737
}
38-
3938
`;
4039

4140
return Promise.resolve()

0 commit comments

Comments
 (0)