Skip to content

Commit

Permalink
chore: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelAquilina committed Apr 2, 2024
1 parent f0ba2da commit 62aceeb
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import { relative } from "path"
import { relative } from 'path';
import { applyPatch } from 'diff';
import { marked } from 'marked';
import * as vscode from 'vscode';
Expand Down Expand Up @@ -226,7 +226,7 @@ export class CodeSuggestionWebviewProvider
}
case 'getAutofixDiffs': {
try {
const suggestion = args.suggestion as Suggestion;
const { suggestion } = args as { suggestion: Suggestion };
const diffs: AutofixUnifiedDiffSuggestion = await vscode.commands.executeCommand(
SNYK_CODE_FIX_DIFFS_COMMAND,
suggestion.folderPath,
Expand All @@ -241,7 +241,10 @@ export class CodeSuggestionWebviewProvider
break;
}
case 'applyGitDiff': {
const { patch, fileUri } = args;
const { patch, fileUri } = args as {
patch: string;
fileUri: string;
};

const fileContent = readFileSync(fileUri, 'utf8');
const patchedContent = applyPatch(fileContent, patch);
Expand Down Expand Up @@ -330,8 +333,8 @@ export class CodeSuggestionWebviewProvider
editor.setDecorations(highlightDecoration, decorationOptions);

// scroll to first added line
let line = editor.document.lineAt(addedLineNumbers[0]);
let range = line.range;
const line = editor.document.lineAt(addedLineNumbers[0]);
const range = line.range;
editor.revealRange(range, vscode.TextEditorRevealType.Default);

// remove highlight on any of:
Expand Down

0 comments on commit 62aceeb

Please sign in to comment.