Skip to content

Commit

Permalink
Fix new eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Apr 4, 2024
1 parent 51b5957 commit 9d60b38
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class MyCompletionItem extends vscode.CompletionItem {
]
};
const response = await client.interruptGetErr(() => client.execute('completionEntryDetails', args, requestToken.token));
if (response.type !== 'response' || !response.body || !response.body.length) {
if (response.type !== 'response' || !response.body?.length) {
return undefined;
}

Expand Down Expand Up @@ -766,7 +766,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
dotAccessorContext = { range, text };
}
}
isIncomplete = !!response.body.isIncomplete || (response as any).metadata && (response as any).metadata.isIncomplete;
isIncomplete = !!response.body.isIncomplete || (response.metadata as any)?.isIncomplete;
entries = response.body.entries;
metadata = response.metadata;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TscTaskProvider extends Disposable implements vscode.TaskProvider {

public async provideTasks(token: vscode.CancellationToken): Promise<vscode.Task[]> {
const folders = vscode.workspace.workspaceFolders;
if ((this.autoDetect === AutoDetect.off) || !folders || !folders.length) {
if ((this.autoDetect === AutoDetect.off) || !folders?.length) {
return [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export function equals(one: any, other: any): boolean {
if (one === other) {
return true;
}
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
if (one === null || one === undefined || other === null || other === undefined) {
return false;
}
Expand Down

0 comments on commit 9d60b38

Please sign in to comment.