Skip to content

Commit ba0614b

Browse files
committed
chore: add more type annotations
1 parent 404aae7 commit ba0614b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/commands/build.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ async function writeTypes(distDir: string, meta: ModuleMeta) {
137137
)
138138
const isStub = moduleTypes.includes('export *')
139139

140-
const appShims = []
141-
const schemaShims = []
142-
const moduleImports = []
140+
const appShims: string[] = []
141+
const schemaShims: string[] = []
142+
const moduleImports: string[] = []
143143

144144
const hasTypeExport = (name: string) => isStub || typeExports.find(exp => exp.names.includes(name))
145145

@@ -154,7 +154,7 @@ async function writeTypes(distDir: string, meta: ModuleMeta) {
154154
}
155155

156156
if (hasTypeExport('ModuleRuntimeHooks')) {
157-
const runtimeHooksInterfaces = []
157+
const runtimeHooksInterfaces: string[] = []
158158

159159
if (hasTypeExport('ModuleRuntimeHooks')) {
160160
runtimeHooksInterfaces.push('ModuleRuntimeHooks')
@@ -184,7 +184,7 @@ ${typeExports[0] ? `\nexport type { ${typeExports[0].names.join(', ')} } from '.
184184

185185
await fsp.writeFile(dtsFile, dtsContents, 'utf8')
186186
if (!existsSync(dtsFileMts)) {
187-
await fsp.writeFile(dtsFileMts, dtsContents.replaceAll('./module', './module.js'), 'utf8')
187+
await fsp.writeFile(dtsFileMts, dtsContents.replace(/\.\/module/g, './module.js'), 'utf8')
188188
}
189189
}
190190

0 commit comments

Comments
 (0)