Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit 3dd4738

Browse files
authored
Merge pull request #556 from Xanewok/tslint-arrow-funcs
Enforce arrow return shorthand rule and fix formatting
2 parents b6fb755 + f0bbec2 commit 3dd4738

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/providers/signatureHelpProvider.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export class SignatureHelpProvider implements vscode.SignatureHelpProvider {
2727
token,
2828
).then(hover => this.hoverToSignatureHelp(hover));
2929
} else if (context.triggerCharacter === ',') {
30-
if (this.previousFunctionPosition && position.line === this.previousFunctionPosition.line) {
30+
if (
31+
this.previousFunctionPosition &&
32+
position.line === this.previousFunctionPosition.line
33+
) {
3134
return this.provideHover(
3235
this.languageClient,
3336
document,
@@ -116,7 +119,10 @@ export class SignatureHelpProvider implements vscode.SignatureHelpProvider {
116119
return undefined;
117120
}
118121

119-
const doc = hover.contents.length > 1 ? hover.contents.slice(-1)[0] as vscode.MarkdownString : undefined;
122+
const doc =
123+
hover.contents.length > 1
124+
? (hover.contents.slice(-1)[0] as vscode.MarkdownString)
125+
: undefined;
120126
const si = new vscode.SignatureInformation(label, doc);
121127

122128
// without parsing the function definition, we don't have a way to get more info on parameters.

tslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"interface-name": [true, "never-prefix"],
1212
"variable-name": [true, "allow-leading-underscore"],
1313
"member-ordering": [true, {"order": "fields-first"}],
14+
"arrow-return-shorthand": true,
1415

1516
"object-literal-sort-keys": false,
1617
"no-console": false,

0 commit comments

Comments
 (0)