]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
style: format code
authorHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 11 Aug 2021 07:35:57 +0000 (15:35 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Wed, 11 Aug 2021 07:35:57 +0000 (15:35 +0800)
index.js
package.json
snapshot.js

index dd5a285e4bf2d1d7e821a96aec9c86e72779bdb7..8911d90fd885f51a41296fc390e1b0853906c0f5 100755 (executable)
--- 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'
index 259e7d62e022867ad003a909cf64c7958e952733..9a18d0d79b711d8a17b555a0c715c8e1b3224ad2 100644 (file)
@@ -35,5 +35,8 @@
     "kolorist": "^1.5.0",
     "minimist": "^1.2.5",
     "prompts": "^2.4.1"
+  },
+  "devDependencies": {
+    "prettier": "^2.3.2"
   }
 }
index aa65b034d1737fd10a4f184a5a337a8f2d349de7..a42018f14a83422fd7a143c1307ea33dd5f28ba3 100644 (file)
@@ -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 = []