From: Haoqun Jiang Date: Wed, 11 Aug 2021 07:35:57 +0000 (+0800) Subject: style: format code X-Git-Tag: v3.0.0-alpha.2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea858fa2ba0ce5c3db68f617d5034da2d65b8bb1;p=thirdparty%2Fvuejs%2Fcreate-vue.git style: format code --- diff --git a/index.js b/index.js index dd5a285e..8911d90f 100755 --- a/index.js +++ b/index.js @@ -52,17 +52,25 @@ async function init() { // --with-tests / --tests / --cypress const argv = minimist(process.argv.slice(2), { alias: { - 'typescript': ['ts'], + typescript: ['ts'], 'with-tests': ['tests', 'cypress'], - 'router': ['vue-router'] + router: ['vue-router'] }, // all arguments are treated as booleans boolean: true }) // if any of the feature flags is set, we would skip the feature prompts - // use `??` instead of `||` once we drop Node.js 12 support - const isFeatureFlagsUsed = typeof (argv.default || argv.ts || argv.jsx || argv.router || argv.vuex || argv.tests) === 'boolean' + // use `??` instead of `||` once we drop Node.js 12 support + const isFeatureFlagsUsed = + typeof ( + argv.default || + argv.ts || + argv.jsx || + argv.router || + argv.vuex || + argv.tests + ) === 'boolean' let targetDir = argv._[0] const defaultProjectName = !targetDir ? 'vue-project' : targetDir @@ -137,8 +145,7 @@ async function init() { { name: 'needsRouter', type: () => (isFeatureFlagsUsed ? null : 'toggle'), - message: - 'Add Vue Router for Single Page Application development?', + message: 'Add Vue Router for Single Page Application development?', initial: false, active: 'Yes', inactive: 'No' @@ -146,8 +153,7 @@ async function init() { { name: 'needsVuex', type: () => (isFeatureFlagsUsed ? null : 'toggle'), - message: - 'Add Vuex for state management?', + message: 'Add Vuex for state management?', initial: false, active: 'Yes', inactive: 'No' diff --git a/package.json b/package.json index 259e7d62..9a18d0d7 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,8 @@ "kolorist": "^1.5.0", "minimist": "^1.2.5", "prompts": "^2.4.1" + }, + "devDependencies": { + "prettier": "^2.3.2" } } diff --git a/snapshot.js b/snapshot.js index aa65b034..a42018f1 100644 --- a/snapshot.js +++ b/snapshot.js @@ -6,26 +6,12 @@ const playgroundDir = new URL('./playground/', import.meta.url).pathname function createProjectWithFeatureFlags(flags) { const projectName = flags.join('-') console.log(`Creating project ${projectName}`) - spawnSync( - 'node', - [ - bin, - projectName, - ...flags.map(flag => `--${flag}`) - ], - { - cwd: playgroundDir - } - ) + spawnSync('node', [bin, projectName, ...flags.map((flag) => `--${flag}`)], { + cwd: playgroundDir + }) } -const featureFlags = [ - 'typescript', - 'jsx', - 'router', - 'vuex', - 'with-tests' -] +const featureFlags = ['typescript', 'jsx', 'router', 'vuex', 'with-tests'] function getCombinations(arr) { const combinations = []