Skip to content

Commit 4144394

Browse files
trickstivalhaoqunjiang
authored andcommitted
style: small style fixes (#3063)
* style(babel-prompt): Using else if instead of double blocks * style(Creator): shouldInitGit doesn't need to be async
1 parent 554670b commit 4144394

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/@vue/cli/lib/Creator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ module.exports = class Creator extends EventEmitter {
135135

136136
// intilaize git repository before installing deps
137137
// so that vue-cli-service can setup git hooks.
138-
const shouldInitGit = await this.shouldInitGit(cliOptions)
138+
const shouldInitGit = this.shouldInitGit(cliOptions)
139139
if (shouldInitGit) {
140140
logWithSpinner(`🗃`, `Initializing git repository...`)
141141
this.emit('creation', { event: 'git-init' })
@@ -449,7 +449,7 @@ module.exports = class Creator extends EventEmitter {
449449
return prompts
450450
}
451451

452-
async shouldInitGit (cliOptions) {
452+
shouldInitGit (cliOptions) {
453453
if (!hasGit()) {
454454
return false
455455
}

packages/@vue/cli/lib/promptModules/babel.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ module.exports = cli => {
1313
if (!answers.useTsWithBabel) {
1414
return
1515
}
16-
} else {
17-
if (!answers.features.includes('babel')) {
18-
return
19-
}
16+
} else if (!answers.features.includes('babel')) {
17+
return
2018
}
2119
options.plugins['@vue/cli-plugin-babel'] = {}
2220
})

0 commit comments

Comments
 (0)