Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ VITE+ - The Unified Toolchain for the Web

◇ Migrated . to Vite+<repeat>
• Node <semver> pnpm <semver>
3 config updates applied
4 config updates applied
! Warnings:
- Removed `"esModuleInterop": false` from tsconfig.json — this option has been deprecated. See https://github.com/oxc-project/tsgolint/issues/351, https://github.com/microsoft/TypeScript/issues/62529
- Removed `"allowSyntheticDefaultImports": false` from tsconfig.json — this option has been deprecated. See https://github.com/oxc-project/tsgolint/issues/351, https://github.com/microsoft/TypeScript/issues/62529

> cat tsconfig.json # verify esModuleInterop: false is removed
{
"compilerOptions": {
"target": "ES2023",
"module": "ESNext",
"allowSyntheticDefaultImports": true,
"strict": true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "ES2023",
"module": "ESNext",
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"allowSyntheticDefaultImports": false,
"strict": true
}
}
25 changes: 14 additions & 11 deletions packages/cli/src/migration/migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { getSpinner } from '../utils/prompts.js';
import {
findTsconfigFiles,
hasBaseUrlInTsconfig,
removeEsModuleInteropFalseFromFile,
removeDeprecatedTsconfigFalseOption,
} from '../utils/tsconfig.js';
import { editYamlFile, scalarString, type YamlDocument } from '../utils/yaml.js';
import {
Expand Down Expand Up @@ -652,19 +652,22 @@ function cleanupDeprecatedTsconfigOptions(
silent = false,
report?: MigrationReport,
): void {
const deprecatedOptions = ['esModuleInterop', 'allowSyntheticDefaultImports'];
const files = findTsconfigFiles(projectPath);
for (const filePath of files) {
if (removeEsModuleInteropFalseFromFile(filePath)) {
if (report) {
report.removedConfigCount++;
}
if (!silent) {
prompts.log.success(`✔ Removed esModuleInterop: false from ${displayRelative(filePath)}`);
for (const name of deprecatedOptions) {
if (removeDeprecatedTsconfigFalseOption(filePath, name)) {
if (report) {
report.removedConfigCount++;
}
if (!silent) {
prompts.log.success(`✔ Removed ${name}: false from ${displayRelative(filePath)}`);
}
warnMigration(
`Removed \`"${name}": false\` from ${displayRelative(filePath)} — this option has been deprecated. See https://github.com/oxc-project/tsgolint/issues/351, https://github.com/microsoft/TypeScript/issues/62529`,
report,
);
}
warnMigration(
`Removed \`"esModuleInterop": false\` from ${displayRelative(filePath)} — this option has been deprecated. See https://github.com/oxc-project/tsgolint/issues/351, https://github.com/microsoft/TypeScript/issues/62529`,
report,
);
}
}
}
Expand Down
Loading
Loading