Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: [lint] Remove no-unused-vars warnings #1261

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"no-extra-semi": "warn",
"no-case-declarations": "warn",
"no-useless-escape" : "warn",
"no-prototype-builtins": "warn"
"no-prototype-builtins": "warn",
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
}
}
2 changes: 1 addition & 1 deletion src/CfgEditor/CfgEditorPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class CfgEditorPanel implements vscode.CustomTextEditorProvider {
}
});

webviewPanel.onDidChangeViewState(e => {
webviewPanel.onDidChangeViewState(() => {
if (webviewPanel.visible) {
vscode.commands.executeCommand('one.explorer.revealInOneExplorer', document.fileName);
}
Expand Down
2 changes: 1 addition & 1 deletion src/CircleGraph/CircleGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class CircleGraphPanel extends CircleGraphCtrl {
this._panel.onDidDispose(() => this.dispose(), null, this._disposables);

// Update the content based on view changes
this._panel.onDidChangeViewState(e => {
this._panel.onDidChangeViewState(() => {
if (this._panel.visible) {
// NOTE if we call this.update(), it'll reload the model which may take time.
// TODO call conditional this.update() when necessary.
Expand Down
2 changes: 1 addition & 1 deletion src/CircleGraph/CircleGraphCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ export class CircleGraphCtrl {
total: this._modelLength,
responseArray: modelData
});
fs.close(fd, (err) => {});
fs.close(fd, () => {});
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/CircleGraph/CircleViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class CircleViewerProvider implements

// CustomReadonlyEditorProvider implements
async openCustomDocument(
uri: vscode.Uri, openContext: {backupId?: string},
uri: vscode.Uri, _openContext: {backupId?: string},
_token: vscode.CancellationToken): Promise<CircleViewerDocument> {
const document: CircleViewerDocument = await CircleViewerDocument.create(uri);
// NOTE as a readonly viewer, there is not much to do
Expand Down
3 changes: 1 addition & 2 deletions src/Execute/DeviceViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {globalBackendMap} from '../Backend/API';
import {Command} from '../Backend/Command';
import {Executor} from '../Backend/Executor';
import {DeviceSpec, supportedSpecs} from '../Backend/Spec';
import {Balloon} from '../Utils/Balloon';
import {Logger} from '../Utils/Logger';

import {Device} from './Device';
Expand Down Expand Up @@ -150,7 +149,7 @@ export class DeviceViewProvider implements vscode.TreeDataProvider<DeviceViewNod
}

private getDevicesPromise(cmd: Command, deviceSpec: DeviceSpec): Promise<Device[]> {
return new Promise<Device[]>((resolve, reject) => {
return new Promise<Device[]>((resolve) => {
let result: string = '';
let error: string = '';
let cmdSpawn = cp.spawn(cmd.str(), {shell: false});
Expand Down
1 change: 0 additions & 1 deletion src/Job/ToolRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {Logger} from '../Utils/Logger';
import {pipedSpawn} from '../Utils/PipedSpawn';
import {ToolArgs} from './ToolArgs';

const path = require('path');
const which = require('which');

const K_DATA: string = 'data';
Expand Down
2 changes: 1 addition & 1 deletion src/Jsontracer/JsonTracerViewerPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class JsonTracerViewerPanel implements vscode.CustomTextEditorProvider {
}
});

webviewPanel.onDidChangeViewState(e => {
webviewPanel.onDidChangeViewState(() => {
vscode.commands.executeCommand(
'setContext', JsonTracerViewerPanel.viewType, webviewPanel.visible);
}, null, this._disposables);
Expand Down
8 changes: 4 additions & 4 deletions src/PartEditor/PartEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class PartEditor implements PartGraphEvent {
});

this._panel.onDidChangeViewState(
e => {
() => {
// TODO implement
},
null, this._disposables);
Expand Down Expand Up @@ -286,7 +286,7 @@ class PartEditor implements PartGraphEvent {
}
});

cmd.on(K_ERROR, (err) => {
cmd.on(K_ERROR, () => {
let msg = 'Failed to run circle-operator: ' + this._modelFileName;
Balloon.error(msg);
reject(msg);
Expand Down Expand Up @@ -352,7 +352,7 @@ class PartEditor implements PartGraphEvent {
}

// PartGraphEvent implements
public onSelection(names: string[], tensors: string[]) {
public onSelection(names: string[], _tensors: string[]) {
this._webview.postMessage({command: 'selectWithNames', selection: names});
}
}
Expand Down Expand Up @@ -388,7 +388,7 @@ export class PartEditorProvider implements vscode.CustomTextEditorProvider, Part

public async resolveCustomTextEditor(
document: vscode.TextDocument, webviewPanel: vscode.WebviewPanel,
token: vscode.CancellationToken): Promise<void> {
_token: vscode.CancellationToken): Promise<void> {
let partEditor = new PartEditor(document, webviewPanel, PartEditorProvider.nextId++);
this._partEditors.push(partEditor);

Expand Down
2 changes: 1 addition & 1 deletion src/PartEditor/PartGraphSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class PartGraphSelPanel extends CircleGraphCtrl implements CircleGraphEve
this._panel.onDidDispose(() => this.dispose(), null, this._disposables);

// Update the content based on view changes
this._panel.onDidChangeViewState(e => {
this._panel.onDidChangeViewState(() => {
if (this._panel.visible) {
// NOTE if we call this.update(), it'll reload the model which may take time.
// TODO call conditional this.update() when necessary.
Expand Down
6 changes: 3 additions & 3 deletions src/Utils/MultiStepInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ interface InputBoxParameters {

/* istanbul ignore next */
class MultiStepInput {
static async run<T>(start: InputStep) {
static async run(start: InputStep) {
const input = new MultiStepInput();
return input.stepThrough(start);
}

static async runSteps<T>(steps: InputStep[]) {
static async runSteps(steps: InputStep[]) {
if (steps.length === 0) {
throw new Error('not enough steps');
}
Expand All @@ -80,7 +80,7 @@ class MultiStepInput {
// this variable sets to public.
public steps: InputStep[] = [];

private async stepThrough<T>(start: InputStep) {
private async stepThrough(start: InputStep) {
let step: InputStep|void = start;
while (step) {
this.steps.push(step);
Expand Down
4 changes: 2 additions & 2 deletions src/View/InstallQuickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {InputStep, MultiStepInput} from '../Utils/MultiStepInput';
async function shouldResume() {
// Could show a notification with the option to resume.
return new Promise<boolean>(
(resolve, reject) => {
() => {
// noop
});
}
Expand Down Expand Up @@ -268,7 +268,7 @@ class InstallQuickInput {
}

/* istanbul ignore next */
public async updateBackend(input: MultiStepInput, state: Partial<InstallQuickInputState>) {
public async updateBackend(input: MultiStepInput, _state: Partial<InstallQuickInputState>) {
if (this.toolchainEnv === undefined || this.toolchainType === undefined) {
this.error = 'toolchainenv is undefined.';
throw Error('toolchainenv is undefined.');
Expand Down