Skip to content

Commit

Permalink
fix: Stop after linting first file and add prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermelimak committed Dec 10, 2017
1 parent 607bdad commit d66cafa
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ class PrettierVue {
this.modified = {}
this.prettierOpts = {}

if (opts._ && opts._.length) {
const path = `${this.baseDir}/${opts._[0]}`
prettier.resolveConfig(this.configPath).then(options => {
this.prettierOpts = options

if (opts._ && opts._.length) {
const path = `${this.baseDir}/${opts._[0]}`

if (!isVueSFC(path)) {
if (!isVueSFC(path)) {
return
}

this.format(path)
this.writeModified()
return
}

this.format(path)
this.writeModified()
}

prettier.resolveConfig(this.configPath).then(options => {
this.prettierOpts = options
this.searchFiles()
})
}
Expand Down

0 comments on commit d66cafa

Please sign in to comment.