Skip to content

Commit 87380be

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 0d3d9ef commit 87380be

File tree

5 files changed

+29
-77
lines changed

5 files changed

+29
-77
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';
@@ -40,23 +40,21 @@
4040
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
4141

4242

43-
/** Evergreen browsers require these. **/
43+
/** Evergreen browsers require these. */
4444
import 'core-js/es6/reflect';
4545
import 'core-js/es7/reflect';
4646

4747

48-
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
48+
/** ALL Firefox browsers require the following to support `@angular/animation`. */
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(

packages/@angular/cli/blueprints/ng/files/e2e/app.e2e-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ describe('<%= htmlComponentName %> App', () => {
77
page = new <%= jsComponentName %>Page();
88
});
99

10-
it('should display welcome message', done => {
10+
it('should display welcome message', (done) => {
1111
page.navigateTo();
1212
page.getParagraphText()
13-
.then(msg => expect(msg).toEqual('Welcome to <%= prefix %>!!'))
13+
.then((msg) => expect(msg).toEqual('Welcome to <%= prefix %>!!'))
1414
.then(done, done.fail);
1515
});
1616
});
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-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ function check(val: any, fxState: any) {
3030
fxState.num = val + "";
3131
}
3232
}
33-
34-
`;
33+
`;
3534

3635
return Promise.resolve()
3736
.then(() => writeFile(fileName, fileContents))

0 commit comments

Comments
 (0)