sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
868 stars 44 forks source link

Generator function not being fixed #19

Closed mcchrish closed 7 years ago

mcchrish commented 7 years ago

Reproduction: https://github.com/mcchrish/prettier-standard-bug.

  1. npm run lint
  2. npm run format
  3. npm run lint

Results to:

$ standard index.js
standard: Use JavaScript Standard Style (https://standardjs.com)
standard: Run `standard --fix` to automatically fix some problems.
  /Users/mcchris/steve/prettier-standard-bug/index.js:1:9: Missing space before *.
error Command failed with exit code 1.

prettier-standard will format the following from:

function * test () {
  console.log('test')
}

test()

to:

function* test () {
  console.log('test')
}

test()

Workaround is running standard --fix after running format. I assumed this library will just pipe the result of prettier into standard --fix. There seems to be a bug?

sheerun commented 7 years ago

Indeed, this seems like a bug. I've fixed in in prettier-standard 6.x.x, as not all fixable rules from standard are included by default.