chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -66,11 +66,17 @@ function resolveBundledPluginSources(params: {
const bundled = new Map<string, BundledPluginSource>();
for (const candidate of discovery.candidates) {
if (candidate.origin !== "bundled") continue;
if (candidate.origin !== "bundled") {
continue;
}
const manifest = loadPluginManifest(candidate.rootDir);
if (!manifest.ok) continue;
if (!manifest.ok) {
continue;
}
const pluginId = manifest.manifest.id;
if (bundled.has(pluginId)) continue;
if (bundled.has(pluginId)) {
continue;
}
const npmSpec =
candidate.packageManifest?.install?.npmSpec?.trim() ||
@@ -88,7 +94,9 @@ function resolveBundledPluginSources(params: {
}
function pathsEqual(left?: string, right?: string): boolean {
if (!left || !right) return false;
if (!left || !right) {
return false;
}
return resolveUserPath(left) === resolveUserPath(right);
}
@@ -100,7 +108,9 @@ function buildLoadPathHelpers(existing: string[]) {
const addPath = (value: string) => {
const normalized = resolveUserPath(value);
if (resolved.has(normalized)) return;
if (resolved.has(normalized)) {
return;
}
paths.push(value);
resolved.add(normalized);
changed = true;
@@ -108,7 +118,9 @@ function buildLoadPathHelpers(existing: string[]) {
const removePath = (value: string) => {
const normalized = resolveUserPath(value);
if (!resolved.has(normalized)) return;
if (!resolved.has(normalized)) {
return;
}
paths = paths.filter((entry) => resolveUserPath(entry) !== normalized);
resolved = resolveSet();
changed = true;
@@ -314,13 +326,17 @@ export async function syncPluginsForUpdateChannel(params: {
if (params.channel === "dev") {
for (const [pluginId, record] of Object.entries(installs)) {
const bundledInfo = bundled.get(pluginId);
if (!bundledInfo) continue;
if (!bundledInfo) {
continue;
}
loadHelpers.addPath(bundledInfo.localPath);
const alreadyBundled =
record.source === "path" && pathsEqual(record.sourcePath, bundledInfo.localPath);
if (alreadyBundled) continue;
if (alreadyBundled) {
continue;
}
next = recordPluginInstall(next, {
pluginId,
@@ -336,15 +352,21 @@ export async function syncPluginsForUpdateChannel(params: {
} else {
for (const [pluginId, record] of Object.entries(installs)) {
const bundledInfo = bundled.get(pluginId);
if (!bundledInfo) continue;
if (!bundledInfo) {
continue;
}
if (record.source === "npm") {
loadHelpers.removePath(bundledInfo.localPath);
continue;
}
if (record.source !== "path") continue;
if (!pathsEqual(record.sourcePath, bundledInfo.localPath)) continue;
if (record.source !== "path") {
continue;
}
if (!pathsEqual(record.sourcePath, bundledInfo.localPath)) {
continue;
}
const spec = record.spec ?? bundledInfo.npmSpec;
if (!spec) {