Skip to content

Commit

Permalink
style(tslint): ban workspace.showMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
weirongxu committed Sep 20, 2019
1 parent 86b2a1b commit a3f1e74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/calc-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export class CalcProvider implements CompletionItemProvider {
private enableDebug: boolean;
private enableReplaceOriginalExpression: boolean;

constructor(public config: WorkspaceConfiguration, private onError: (error: Error) => any) {
constructor(
public config: WorkspaceConfiguration,
private onError: (error: Error) => any,
) {
this.srcId = workspace.createNameSpace('coc-calc');
this.enableActive = false;
this.enableDebug = this.config.get<boolean>('debug', false);
Expand Down Expand Up @@ -134,6 +137,7 @@ export class CalcProvider implements CompletionItemProvider {
];
} catch (error) {
if (this.enableDebug) {
// tslint:disable-next-line: ban
workspace.showMessage(error.message, 'error');
}
return [];
Expand Down
6 changes: 5 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"semicolon": true,
"trailing-comma": [true, "all"],
"quotemark": [true, "single"],
"no-floating-promises": true
"no-floating-promises": true,
"ban": [
true,
["workspace", "showMessage"]
]
}
}

0 comments on commit a3f1e74

Please sign in to comment.