build(tslint): disallow var keyword (#3625)

* Disallows the var-keyboard in the source files. `var` mostly causes issues with variables, and can be safely replaced with `let`.
This commit is contained in:
Paul Gschwendtner
2017-03-17 19:15:50 +01:00
committed by mmalerba
parent 6b6b392c90
commit f526c9de87
5 changed files with 5 additions and 6 deletions
+1 -3
View File
@@ -28,9 +28,7 @@ export class ExampleData {
}
this.selectorName = this.indexFilename = `${example}-example`;
var exampleName = example.replace(/(?:^\w|\b\w)/g, function(letter) {
return letter.toUpperCase();
});
let exampleName = example.replace(/(?:^\w|\b\w)/g, letter => letter.toUpperCase());
if (EXAMPLE_COMPONENTS[example].title) {
this.description = EXAMPLE_COMPONENTS[example].title;
+1 -1
View File
@@ -36,7 +36,7 @@ export const MD_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR: any = {
multi: true
};
var _uniqueIdCounter = 0;
let _uniqueIdCounter = 0;
/** Change event object emitted by MdButtonToggle. */
export class MdButtonToggleChange {
+1 -1
View File
@@ -402,7 +402,7 @@ export class MdCheckbox implements ControlValueAccessor, AfterViewInit, OnDestro
private _getAnimationClassForCheckStateTransition(
oldState: TransitionCheckState, newState: TransitionCheckState): string {
var animSuffix: string;
let animSuffix: string;
switch (oldState) {
case TransitionCheckState.Init:
+1 -1
View File
@@ -39,7 +39,7 @@ export const MD_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: any = {
multi: true
};
var _uniqueIdCounter = 0;
let _uniqueIdCounter = 0;
/** Change event object emitted by MdRadio and MdRadioGroup. */
export class MdRadioChange {
+1
View File
@@ -25,6 +25,7 @@
"no-shadowed-variable": true,
"no-unused-expression": true,
"no-unused-var": [true, {"ignore-pattern": "^(_.*)$"}],
"no-var-keyword": true,
"no-debugger": true,
"one-line": [
true,