Skip to content

Commit df4382f

Browse files
alan-agius4mgechev
authored andcommitted
feat(@schematics/angular): update default tslint.json rules
In tslint version 6, several recommanded rules have been removed in the following PRs: palantir/tslint#4871 palantir/tslint#4312 With this change, we bring back these rules in the CLI.
1 parent cecb3de commit df4382f

File tree

2 files changed

+65
-8
lines changed

2 files changed

+65
-8
lines changed

packages/schematics/angular/application/index_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ describe('Application Schematic', () => {
378378
const content = JSON.parse(tree.readContent('/tslint.json'));
379379
expect(content.extends).toMatch('tslint:recommended');
380380
expect(content.rules['component-selector'][2]).toMatch('app');
381-
expect(content.rules['trailing-comma']).toBeDefined();
381+
expect(content.rules['no-console']).toBeDefined();
382382
});
383383

384384
it(`should create correct paths when 'newProjectRoot' is blank`, async () => {

packages/schematics/angular/workspace/files/tslint.json.template

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,34 @@
44
"codelyzer"
55
],
66
"rules": {
7+
"align": {
8+
"options": [
9+
"parameters",
10+
"statements"
11+
]
12+
},
713
"array-type": false,
8-
"arrow-parens": false,
14+
"arrow-return-shorthand": true,
15+
"curly": true,
916
"deprecation": {
1017
"severity": "warning"
1118
},
19+
"eofline": true,
1220
"import-blacklist": [
1321
true,
1422
"rxjs/Rx"
1523
],
16-
"interface-name": false,
24+
"import-spacing": true,
25+
"indent": {
26+
"options": [
27+
"spaces"
28+
]
29+
},
1730
"max-classes-per-file": false,
1831
"max-line-length": [
1932
true,
2033
140
2134
],
22-
"member-access": false,
2335
"member-ordering": [
2436
true,
2537
{
@@ -31,7 +43,6 @@
3143
]
3244
}
3345
],
34-
"no-consecutive-blank-lines": false,
3546
"no-console": [
3647
true,
3748
"debug",
@@ -53,13 +64,59 @@
5364
true,
5465
"as-needed"
5566
],
56-
"object-literal-sort-keys": false,
57-
"ordered-imports": false,
5867
"quotemark": [
5968
true,
6069
"single"
6170
],
62-
"trailing-comma": false,
71+
"semicolon": {
72+
"options": [
73+
"always"
74+
]
75+
},
76+
"space-before-function-paren": {
77+
"options": {
78+
"anonymous": "never",
79+
"asyncArrow": "always",
80+
"constructor": "never",
81+
"method": "never",
82+
"named": "never"
83+
}
84+
},
85+
"typedef-whitespace": {
86+
"options": [
87+
{
88+
"call-signature": "nospace",
89+
"index-signature": "nospace",
90+
"parameter": "nospace",
91+
"property-declaration": "nospace",
92+
"variable-declaration": "nospace"
93+
},
94+
{
95+
"call-signature": "onespace",
96+
"index-signature": "onespace",
97+
"parameter": "onespace",
98+
"property-declaration": "onespace",
99+
"variable-declaration": "onespace"
100+
}
101+
]
102+
},
103+
"variable-name": {
104+
"options": [
105+
"ban-keywords",
106+
"check-format",
107+
"allow-pascal-case"
108+
]
109+
},
110+
"whitespace": {
111+
"options": [
112+
"check-branch",
113+
"check-decl",
114+
"check-operator",
115+
"check-separator",
116+
"check-type",
117+
"check-typecast"
118+
]
119+
},
63120
"component-class-suffix": true,
64121
"contextual-lifecycle": true,
65122
"directive-class-suffix": true,

0 commit comments

Comments
 (0)