From b21bb44c8dcd43e9e42ef7e3d752dd550e6505ad Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Thu, 12 Dec 2019 00:41:16 +0900 Subject: Enable noUnusedParameters option for vscode extension --- editors/code/src/commands/analyzer_status.ts | 2 +- editors/code/src/commands/expand_macro.ts | 2 +- editors/code/src/commands/runnables.ts | 2 +- editors/code/tsconfig.json | 3 ++- editors/code/tslint.json | 4 +++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/editors/code/src/commands/analyzer_status.ts b/editors/code/src/commands/analyzer_status.ts index 9e4ce0eb3..2777ced24 100644 --- a/editors/code/src/commands/analyzer_status.ts +++ b/editors/code/src/commands/analyzer_status.ts @@ -9,7 +9,7 @@ export class TextDocumentContentProvider public syntaxTree: string = 'Not available'; public provideTextDocumentContent( - uri: vscode.Uri, + _uri: vscode.Uri, ): vscode.ProviderResult { const editor = vscode.window.activeTextEditor; if (editor == null) { diff --git a/editors/code/src/commands/expand_macro.ts b/editors/code/src/commands/expand_macro.ts index 842898020..17c78280a 100644 --- a/editors/code/src/commands/expand_macro.ts +++ b/editors/code/src/commands/expand_macro.ts @@ -11,7 +11,7 @@ export class ExpandMacroContentProvider public eventEmitter = new vscode.EventEmitter(); public provideTextDocumentContent( - uri: vscode.Uri, + _uri: vscode.Uri, ): vscode.ProviderResult { async function handle() { const editor = vscode.window.activeTextEditor; diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index 9b1c6643d..c81d7ce0f 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts @@ -178,7 +178,7 @@ export async function startCargoWatch( } const label = 'install-cargo-watch'; - const taskFinished = new Promise((resolve, reject) => { + const taskFinished = new Promise((resolve, _reject) => { const disposable = vscode.tasks.onDidEndTask(({ execution }) => { if (execution.task.name === label) { disposable.dispose(); diff --git a/editors/code/tsconfig.json b/editors/code/tsconfig.json index 8cb1e9035..9ddf56347 100644 --- a/editors/code/tsconfig.json +++ b/editors/code/tsconfig.json @@ -7,7 +7,8 @@ "sourceMap": true, "rootDir": "src", "strict": true, - "noUnusedLocals": true + "noUnusedLocals": true, + "noUnusedParameters": true }, "exclude": ["node_modules", ".vscode-test"] } diff --git a/editors/code/tslint.json b/editors/code/tslint.json index bdeb4895e..b69c5574d 100644 --- a/editors/code/tslint.json +++ b/editors/code/tslint.json @@ -4,6 +4,8 @@ "rules": { "quotemark": [true, "single"], "interface-name": false, - "object-literal-sort-keys": false + "object-literal-sort-keys": false, + // Allow `_bar` to sort with tsc's `noUnusedParameters` option + "variable-name": [true, "allow-leading-underscore"] } } -- cgit v1.2.3