Skip to content

Commit a4aeca7

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: angular#6179
1 parent 2a52691 commit a4aeca7

File tree

5 files changed

+26
-76
lines changed

5 files changed

+26
-76
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
@@ -40,8 +27,6 @@
4027
]
4128
}
4229
],
43-
"no-arg": true,
44-
"no-bitwise": true,
4530
"no-console": [
4631
true,
4732
"debug",
@@ -50,70 +35,36 @@
5035
"timeEnd",
5136
"trace"
5237
],
53-
"no-construct": true,
54-
"no-debugger": true,
55-
"no-duplicate-super": true,
38+
"no-consecutive-blank-lines": [
39+
true,
40+
2
41+
],
5642
"no-empty": false,
57-
"no-empty-interface": true,
58-
"no-eval": true,
5943
"no-inferrable-types": [
6044
true,
6145
"ignore-params"
6246
],
63-
"no-misused-new": true,
6447
"no-non-null-assertion": true,
65-
"no-shadowed-variable": true,
6648
"no-string-literal": false,
67-
"no-string-throw": true,
6849
"no-switch-case-fall-through": true,
69-
"no-trailing-whitespace": true,
70-
"no-unnecessary-initializer": true,
71-
"no-unused-expression": true,
50+
"no-trailing-whitespace": [
51+
true,
52+
"ignore-template-strings"
53+
],
7254
"no-use-before-declare": true,
73-
"no-var-keyword": true,
7455
"object-literal-sort-keys": false,
75-
"one-line": [
76-
true,
77-
"check-open-brace",
78-
"check-catch",
79-
"check-else",
80-
"check-whitespace"
56+
"ordered-imports": [
57+
false
8158
],
82-
"prefer-const": true,
8359
"quotemark": [
8460
true,
85-
"single"
86-
],
87-
"radix": true,
88-
"semicolon": [
89-
true,
90-
"always"
91-
],
92-
"triple-equals": [
93-
true,
94-
"allow-null-check"
61+
"single",
62+
"avoid-escape"
9563
],
96-
"typedef-whitespace": [
97-
true,
98-
{
99-
"call-signature": "nospace",
100-
"index-signature": "nospace",
101-
"parameter": "nospace",
102-
"property-declaration": "nospace",
103-
"variable-declaration": "nospace"
104-
}
64+
"trailing-comma": [
65+
false
10566
],
106-
"typeof-compare": true,
107-
"unified-signatures": true,
10867
"variable-name": false,
109-
"whitespace": [
110-
true,
111-
"check-branch",
112-
"check-decl",
113-
"check-operator",
114-
"check-separator",
115-
"check-type"
116-
],
11768
"directive-selector": [
11869
true,
11970
"attribute",
@@ -138,5 +89,8 @@
13889
"no-access-missing-member": true,
13990
"templates-use-public": true,
14091
"invoke-injectable": true
141-
}
92+
},
93+
"rulesDirectory": [
94+
"node_modules/codelyzer"
95+
]
14296
}

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)