Skip to content

Commit 84d25c8

Browse files
GaryB432Foxandxss
authored andcommitted
update codelyzer and related (preboot#279)
* update codelyzer and related * add templates-use-public tslint rule * add compiler options for unused forbids unused locals and unused paramters * revert typescript to 2.0
1 parent 4f25b28 commit 84d25c8

File tree

5 files changed

+32
-18
lines changed

5 files changed

+32
-18
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"angular2-template-loader": "^0.6.0",
4949
"autoprefixer": "^6.3.2",
5050
"awesome-typescript-loader": "^3.0.0-beta.17",
51-
"codelyzer": "1.0.0-beta.3",
51+
"codelyzer": "2.0.0-beta.4",
5252
"copy-webpack-plugin": "^4.0.0",
5353
"css-loader": "^0.26.1",
5454
"extract-text-webpack-plugin": "^2.0.0-beta.4",
@@ -78,8 +78,8 @@
7878
"shelljs": "^0.7.0",
7979
"style-loader": "^0.13.0",
8080
"ts-helpers": "^1.1.1",
81-
"tslint": "^3.4.0",
82-
"tslint-loader": "^2.1.0",
81+
"tslint": "^4.3.1",
82+
"tslint-loader": "^3.3.0",
8383
"typedoc": "^0.5.1",
8484
"typescript": "2.0.10",
8585
"url-loader": "^0.5.6",

src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</nav>
66
</header>
77
<main>
8-
<h1>Hello from {{api.title}}!</h1>
8+
<h1>Hello from {{title}}!</h1>
99

1010
<!-- Images (and assets) are parsed and loaded from within the public directory -->
1111
<img src="/img/angular.png">

src/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import '../style/app.scss';
1111
})
1212
export class AppComponent {
1313
url = 'https://github.com/preboot/angular2-webpack';
14+
title: string;
1415

1516
constructor(private api: ApiService) {
16-
// Do something with api
17+
this.title = this.api.title;
1718
}
1819
}

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"emitDecoratorMetadata": true,
66
"experimentalDecorators": true,
77
"sourceMap": true,
8-
"noEmitHelpers": true
8+
"noEmitHelpers": true,
9+
"noUnusedLocals": true,
10+
"noUnusedParameters": true
911
},
1012
"compileOnSave": false,
1113
"buildOnSave": false,

tslint.json

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"spaces"
1717
],
1818
"label-position": true,
19-
"label-undefined": true,
2019
"max-line-length": [
2120
true,
2221
140
@@ -39,7 +38,6 @@
3938
],
4039
"no-construct": true,
4140
"no-debugger": true,
42-
"no-duplicate-key": true,
4341
"no-duplicate-variable": true,
4442
"no-empty": false,
4543
"no-eval": true,
@@ -49,8 +47,6 @@
4947
"no-switch-case-fall-through": true,
5048
"no-trailing-whitespace": true,
5149
"no-unused-expression": true,
52-
"no-unused-variable": true,
53-
"no-unreachable": true,
5450
"no-use-before-declare": true,
5551
"no-var-keyword": true,
5652
"object-literal-sort-keys": false,
@@ -92,11 +88,18 @@
9288
"check-separator",
9389
"check-type"
9490
],
95-
96-
"directive-selector-name": [true, "camelCase"],
97-
"component-selector-name": [true, "kebab-case"],
98-
"directive-selector-type": [true, "attribute"],
99-
"component-selector-type": [true, "element"],
91+
"directive-selector": [
92+
true,
93+
"attribute",
94+
"my",
95+
"camelCase"
96+
],
97+
"component-selector": [
98+
true,
99+
"element",
100+
"my",
101+
"kebab-case"
102+
],
100103
"use-input-property-decorator": true,
101104
"use-output-property-decorator": true,
102105
"use-host-property-decorator": true,
@@ -106,8 +109,16 @@
106109
"use-pipe-transform-interface": true,
107110
"component-class-suffix": true,
108111
"directive-class-suffix": true,
109-
"directive-selector-prefix": [true, "my"],
110-
"component-selector-prefix": [true, "my"],
111-
"pipe-naming": [true, "camelCase", "my"]
112+
"pipe-naming": [
113+
true,
114+
"camelCase",
115+
"my"
116+
],
117+
"no-attribute-parameter-decorator": true,
118+
"no-forward-ref": true,
119+
"import-destructuring-spacing": true,
120+
"no-access-missing-member": true,
121+
"templates-use-public": true,
122+
"invoke-injectable": true
112123
}
113124
}

0 commit comments

Comments
 (0)