diff --git a/bin/create-eslint-config.js b/bin/create-eslint-config.js index 46e4a0e..71356f4 100644 --- a/bin/create-eslint-config.js +++ b/bin/create-eslint-config.js @@ -102,9 +102,11 @@ let vueVersion try { vueVersion = requireInCwd('vue/package.json').version console.info(dim(`Detected Vue.js version: ${vueVersion}`)) -} catch {} +} catch { + // Vue.js not found, will prompt later +} -if (!vueVersion || !/^3/.test(vueVersion)) { +if (!vueVersion || !vueVersion.startsWith('3.')) { const { continueAnyway } = await prompt({ type: 'toggle', disabled: 'No', @@ -126,7 +128,9 @@ try { const tsVersion = requireInCwd('typescript/package.json').version console.info(dim(`Detected TypeScript version: ${tsVersion}`)) detectedTypeScript = true -} catch {} +} catch { + // TypeScript not found, will prompt later +} const { hasTypeScript } = await prompt({ type: 'toggle', @@ -138,52 +142,6 @@ const { hasTypeScript } = await prompt({ }) const supportedScriptLangs = {} -// FIXME: Use a multi-select prompt -// if (hasTypeScript) { -// const { allowJsInVue } = await prompt({ -// type: 'toggle', -// disabled: 'No', -// enabled: 'Yes', -// name: 'allowJsInVue', -// message: `Do you use plain ${yellow('