mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
mmalerba
parent
6b6b392c90
commit
f526c9de87
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user