Merge pull request #1404 from Tyriar/no_else_return

Add no else return tslint rule
This commit is contained in:
Daniel Imms
2018-04-24 10:50:27 -07:00
committed by GitHub
4 changed files with 18 additions and 14 deletions
+1
View File
@@ -67,6 +67,7 @@
"npm-run-all": "^4.1.2",
"sorcery": "^0.10.0",
"tslint": "^5.9.1",
"tslint-consistent-codestyle": "^1.13.0",
"typescript": "~2.7.1",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
+3 -4
View File
@@ -92,11 +92,10 @@ export class CompositionHelper {
} else if (ev.keyCode === 16 || ev.keyCode === 17 || ev.keyCode === 18) {
// Continue composing if the keyCode is a modifier key
return false;
} else {
// Finish composition immediately. This is mainly here for the case where enter is
// pressed and the handler needs to be triggered before the command is executed.
this._finalizeComposition(false);
}
// Finish composition immediately. This is mainly here for the case where enter is
// pressed and the handler needs to be triggered before the command is executed.
this._finalizeComposition(false);
}
if (ev.keyCode === 229) {
+6 -9
View File
@@ -73,12 +73,11 @@ export class AltClickHandler {
private _resetStartingRow(): string {
if (this._moveToRequestedRow().length === 0) {
return '';
} else {
return repeat(this._bufferLine(
this._startCol, this._startRow, this._startCol,
this._startRow - this._wrappedRowsForRow(this._startRow), false
).length, this._sequence(Direction.Left));
}
return repeat(this._bufferLine(
this._startCol, this._startRow, this._startCol,
this._startRow - this._wrappedRowsForRow(this._startRow), false
).length, this._sequence(Direction.Left));
}
/**
@@ -180,9 +179,8 @@ export class AltClickHandler {
(this._startCol >= this._endCol &&
startRow < this._endRow)) { // down/left or same y/left
return Direction.Right;
} else {
return Direction.Left;
}
return Direction.Left;
}
/**
@@ -191,9 +189,8 @@ export class AltClickHandler {
private _verticalDirection(): Direction {
if (this._startRow > this._endRow) {
return Direction.Up;
} else {
return Direction.Down;
}
return Direction.Down;
}
/**
+8 -1
View File
@@ -1,4 +1,7 @@
{
"rulesDirectory": [
"tslint-consistent-codestyle"
],
"rules": {
"array-type": [
true,
@@ -86,6 +89,10 @@
"check-type",
"check-type-operator",
"check-preblock"
]
],
"no-else-after-return": {
"options": "allow-else-if"
}
}
}