Skip to content

Commit 9854e06

Browse files
committed
chore: lint
1 parent 3e0f1b7 commit 9854e06

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

packages/vscode/src/highlight.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ export function activateHighlighting(context: vscode.ExtensionContext) {
103103
}
104104

105105
async function showFirstTimeNotification() {
106-
if (hasShownSessionNotification) { return; }
106+
if (hasShownSessionNotification) {
107+
return;
108+
}
107109

108110
vscode.window.showInformationMessage(
109111
'Vue Hook Optimizer: ˄ (requires) ˅ (used by). Can be disabled in settings.',
@@ -113,10 +115,14 @@ export function activateHighlighting(context: vscode.ExtensionContext) {
113115
}
114116

115117
async function ensureAnalysisResult() {
116-
if (!activeEditor) { return null; }
118+
if (!activeEditor) {
119+
return null;
120+
}
117121

118122
const code = activeEditor.document.getText();
119-
if (!code) { return null; }
123+
if (!code) {
124+
return null;
125+
}
120126

121127
const codeHash = hashCode(code);
122128
const fileUri = activeEditor.document.uri.toString();
@@ -161,7 +167,9 @@ export function activateHighlighting(context: vscode.ExtensionContext) {
161167

162168
// 确保有分析结果
163169
const analysisResult = await ensureAnalysisResult();
164-
if (!analysisResult) { return; }
170+
if (!analysisResult) {
171+
return;
172+
}
165173

166174
const { nodes, edges } = analysisResult.data.vis;
167175

@@ -178,7 +186,9 @@ export function activateHighlighting(context: vscode.ExtensionContext) {
178186
let selectedNode = matchingNodes[0];
179187
if (matchingNodes.length > 1) {
180188
selectedNode = matchingNodes.reduce((closest, node) => {
181-
if (!node.info?.line || !closest.info?.line) { return closest; }
189+
if (!node.info?.line || !closest.info?.line) {
190+
return closest;
191+
}
182192
const nodeDistance = Math.abs(node.info.line - cursorLine);
183193
const closestDistance = Math.abs(closest.info.line - cursorLine);
184194
return nodeDistance < closestDistance

0 commit comments

Comments
 (0)