Skip to content

Commit 5e55466

Browse files
committed
fix: linting
1 parent 777b472 commit 5e55466

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

extensions/cli/src/configLoader.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,17 @@ function determineConfigSource(
103103

104104
if (savedUri) {
105105
if (savedUri.startsWith("file:")) {
106+
let exists = false; // wrote like this for nested depth linting rule lol
106107
try {
107-
if (fs.existsSync(fileURLToPath(savedUri))) {
108-
return { type: "saved-uri", uri: savedUri };
109-
} else {
110-
logger.warn("Saved config URI does not exist: " + savedUri);
111-
}
108+
const filepath = fileURLToPath(savedUri);
109+
exists = fs.existsSync(filepath);
112110
} catch (e) {
113-
logger.warn("Invalid saved file URI " + savedUri);
111+
logger.warn("Invalid saved file URI " + savedUri, e);
112+
}
113+
if (exists) {
114+
return { type: "saved-uri", uri: savedUri };
115+
} else {
116+
logger.warn("Saved config URI does not exist: " + savedUri);
114117
}
115118
} else {
116119
// slug

0 commit comments

Comments
 (0)