Merge pull request #1404 from Tyriar/no_else_return
Add no else return tslint rule
This commit is contained in:
@@ -67,6 +67,7 @@
|
|||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
"sorcery": "^0.10.0",
|
"sorcery": "^0.10.0",
|
||||||
"tslint": "^5.9.1",
|
"tslint": "^5.9.1",
|
||||||
|
"tslint-consistent-codestyle": "^1.13.0",
|
||||||
"typescript": "~2.7.1",
|
"typescript": "~2.7.1",
|
||||||
"vinyl-buffer": "^1.0.0",
|
"vinyl-buffer": "^1.0.0",
|
||||||
"vinyl-source-stream": "^1.1.0",
|
"vinyl-source-stream": "^1.1.0",
|
||||||
|
|||||||
@@ -92,11 +92,10 @@ export class CompositionHelper {
|
|||||||
} else if (ev.keyCode === 16 || ev.keyCode === 17 || ev.keyCode === 18) {
|
} else if (ev.keyCode === 16 || ev.keyCode === 17 || ev.keyCode === 18) {
|
||||||
// Continue composing if the keyCode is a modifier key
|
// Continue composing if the keyCode is a modifier key
|
||||||
return false;
|
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) {
|
if (ev.keyCode === 229) {
|
||||||
|
|||||||
@@ -73,12 +73,11 @@ export class AltClickHandler {
|
|||||||
private _resetStartingRow(): string {
|
private _resetStartingRow(): string {
|
||||||
if (this._moveToRequestedRow().length === 0) {
|
if (this._moveToRequestedRow().length === 0) {
|
||||||
return '';
|
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 &&
|
(this._startCol >= this._endCol &&
|
||||||
startRow < this._endRow)) { // down/left or same y/left
|
startRow < this._endRow)) { // down/left or same y/left
|
||||||
return Direction.Right;
|
return Direction.Right;
|
||||||
} else {
|
|
||||||
return Direction.Left;
|
|
||||||
}
|
}
|
||||||
|
return Direction.Left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -191,9 +189,8 @@ export class AltClickHandler {
|
|||||||
private _verticalDirection(): Direction {
|
private _verticalDirection(): Direction {
|
||||||
if (this._startRow > this._endRow) {
|
if (this._startRow > this._endRow) {
|
||||||
return Direction.Up;
|
return Direction.Up;
|
||||||
} else {
|
|
||||||
return Direction.Down;
|
|
||||||
}
|
}
|
||||||
|
return Direction.Down;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+8
-1
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"rulesDirectory": [
|
||||||
|
"tslint-consistent-codestyle"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"array-type": [
|
"array-type": [
|
||||||
true,
|
true,
|
||||||
@@ -86,6 +89,10 @@
|
|||||||
"check-type",
|
"check-type",
|
||||||
"check-type-operator",
|
"check-type-operator",
|
||||||
"check-preblock"
|
"check-preblock"
|
||||||
]
|
],
|
||||||
|
|
||||||
|
"no-else-after-return": {
|
||||||
|
"options": "allow-else-if"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user