Skip to content

Commit 38d5f0b

Browse files
committed
style(tests): format code for better readability in migrator.spec.ts
style(bin): simplify function signature for confirmFrameworkShim
1 parent 278796b commit 38d5f0b

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,10 @@ describe('framework shim', () => {
702702
it('returns false when src/env.d.ts does not contain vue shim', () => {
703703
const srcDir = path.join(tmpDir, 'src');
704704
fs.mkdirSync(srcDir);
705-
fs.writeFileSync(path.join(srcDir, 'env.d.ts'), '/// <reference types="vite-plus/client" />\n');
705+
fs.writeFileSync(
706+
path.join(srcDir, 'env.d.ts'),
707+
'/// <reference types="vite-plus/client" />\n',
708+
);
706709
expect(hasFrameworkShim(tmpDir, 'vue')).toBe(false);
707710
});
708711

@@ -711,10 +714,7 @@ describe('framework shim', () => {
711714
});
712715

713716
it('returns true when root env.d.ts contains astro/client reference', () => {
714-
fs.writeFileSync(
715-
path.join(tmpDir, 'env.d.ts'),
716-
'/// <reference types="astro/client" />\n',
717-
);
717+
fs.writeFileSync(path.join(tmpDir, 'env.d.ts'), '/// <reference types="astro/client" />\n');
718718
expect(hasFrameworkShim(tmpDir, 'astro')).toBe(true);
719719
});
720720
});
@@ -758,7 +758,8 @@ describe('framework shim', () => {
758758
// Simulate create-vue having already written a shim into src/env.d.ts
759759
const srcDir = path.join(tmpDir, 'src');
760760
fs.mkdirSync(srcDir);
761-
const existingShim = "declare module '*.vue' {\n import type { DefineComponent } from 'vue';\n const component: DefineComponent;\n export default component;\n}\n";
761+
const existingShim =
762+
"declare module '*.vue' {\n import type { DefineComponent } from 'vue';\n const component: DefineComponent;\n export default component;\n}\n";
762763
fs.writeFileSync(path.join(srcDir, 'env.d.ts'), existingShim);
763764

764765
const framework = detectFramework(

packages/cli/src/migration/bin.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,7 @@ async function confirmNodeVersionFileMigration(
208208
return true;
209209
}
210210

211-
async function confirmFrameworkShim(
212-
framework: Framework,
213-
interactive: boolean,
214-
): Promise<boolean> {
211+
async function confirmFrameworkShim(framework: Framework, interactive: boolean): Promise<boolean> {
215212
const frameworkNames: Record<Framework, string> = { vue: 'Vue', astro: 'Astro' };
216213
const name = frameworkNames[framework];
217214
if (interactive) {

0 commit comments

Comments
 (0)