Skip to content

Commit 8a802d8

Browse files
committed
fix(migrate): drop redundant casts flagged by oxlint-tsgolint 0.24.0
The merge to main bumped oxlint-tsgolint to 0.24.0, whose no-unnecessary-type-assertion rule flags three more redundant readJsonFile casts. #2000 removed the ones in main's monolith; these live in split modules (vite-plus-bootstrap.ts) and a test, so they were missed by the merge. Remove them so vp check passes. Claude-Session: https://claude.ai/code/session_01DQhS6o1fyQd1yjiee6W8jR
1 parent cc69225 commit 8a802d8

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

packages/cli/src/migration/__tests__/migrator.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,10 +1126,7 @@ describe('collectInstalledPackageNames', () => {
11261126
});
11271127
const available = collectInstalledPackageNames(tmpDir);
11281128
const config = { jsPlugins: ['eslint-plugin-only-peer'] };
1129-
sanitizeMigratedOxlintConfig(
1130-
config as Parameters<typeof sanitizeMigratedOxlintConfig>[0],
1131-
available,
1132-
);
1129+
sanitizeMigratedOxlintConfig(config, available);
11331130
expect(config.jsPlugins).toEqual([]);
11341131
});
11351132
});

packages/cli/src/migration/migrator/vite-plus-bootstrap.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ function someBootstrapProjectPackageJson(
536536
if (!fs.existsSync(packageJsonPath)) {
537537
return false;
538538
}
539-
return predicate(readJsonFile(packageJsonPath) as BootstrapPackageJson);
539+
return predicate(readJsonFile(packageJsonPath));
540540
});
541541
}
542542

@@ -1201,7 +1201,7 @@ function readInstalledRawViteVersion(projectPath: string): string | undefined {
12011201
}
12021202
let pkgJson: RawVitePackageJson;
12031203
try {
1204-
pkgJson = readJsonFile(vitePackageJsonPath) as RawVitePackageJson;
1204+
pkgJson = readJsonFile(vitePackageJsonPath);
12051205
} catch {
12061206
return undefined;
12071207
}

0 commit comments

Comments
 (0)