refactor: simplify initial prompt message for tsconfig path

This commit is contained in:
Sadegh Barati 2024-11-14 22:27:17 +03:30
parent 7a13dd73aa
commit 1b53018951

View File

@ -138,9 +138,8 @@ export async function promptForConfig(
name: 'tsConfigPath', name: 'tsConfigPath',
message: (prev, values) => `Where is your ${highlight(values.typescript ? 'tsconfig.json' : 'jsconfig.json')} file?`, message: (prev, values) => `Where is your ${highlight(values.typescript ? 'tsconfig.json' : 'jsconfig.json')} file?`,
initial: (prev, values) => { initial: (prev, values) => {
const prefix = values.framework === 'nuxt' ? '.nuxt/' : './' const path = values.typescript ? './tsconfig.json' : './jsconfig.json'
const path = values.framework === 'nuxt' ? 'tsconfig.json' : values.typescript ? 'tsconfig.json' : 'jsconfig.json' return path
return prefix + path
}, },
}, },
{ {