The following input is automatically generated by the Vue3 CLI in a shim file named shims-vue.d.ts when making a new TypeScript Vue3 project. The auto-generated code lacks semicolons by default. This default generated code completely breaks once formatted.
Input 1:
declare module '*.vue' {
import type {DefineComponent} from 'vue'
const component: DefineComponent <{}, {}, any>
export default component
}
Output 1:
declare module '*.vue' {
import type {DefineComponent}
from 'vue'
const component: DefineComponent < {}, {},
any > export default component
}
Expected behavior 1:
declare module '*.vue' {
import type {DefineComponent} from 'vue'
const component: DefineComponent < {}, {}, any >
export default component
}
So it might seem that the issue is the lack of semicolons. With them added, the code no longer breaks, but is very oddly formatted that produces less legible code.
Input 2:
declare module '*.vue' {
import type {DefineComponent} from 'vue';
const component: DefineComponent <{}, {}, any>;
export default component;
}
Output 2:
declare module '*.vue' {
import type {DefineComponent}
from 'vue';
const component: DefineComponent < {}, {},
any >;
export default component;
}
Expected behavior 2:
declare module '*.vue' {
import type {DefineComponent} from 'vue';
const component: DefineComponent < {}, {}, any >;
export default component;
}
The following input is automatically generated by the Vue3 CLI in a shim file named
shims-vue.d.tswhen making a new TypeScript Vue3 project. The auto-generated code lacks semicolons by default. This default generated code completely breaks once formatted.Input 1:
Output 1:
Expected behavior 1:
So it might seem that the issue is the lack of semicolons. With them added, the code no longer breaks, but is very oddly formatted that produces less legible code.
Input 2:
Output 2:
Expected behavior 2: