Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

standard gets confused with es6 getter/setter #316

Closed
daviddias opened this issue Nov 4, 2015 · 3 comments

Comments

@daviddias
Copy link

commented Nov 4, 2015

It seems that when standard --formatcatches a es6 getter/setter, it changes its format and than reports a codestyle error, see example below

var log = ['test']
var obj = {
  get latest () {
    if (log.length === 0) return undefined
    return log[log.length - 1]
  }
}
console.log(obj.latest)

The right space was there, but then

» standard --format troll.js
standard: Use JavaScript Standard Style (https://github.com/feross/standard)
  /Users/david/Documents/code/standard-troll/troll.js:3:13: Missing space before function parentheses.

Fixing the problem and running standard returns no errors, but then if standard --formatis executed, it will remove the space again and report an error

@nekolab

This comment has been minimized.

Copy link

commented Nov 25, 2015

Hi, I ran into this issue too, it's annoying, any updates?

@bcomnes

This comment has been minimized.

Copy link
Member

commented Nov 25, 2015

Its an issue with standard-format and not standard (which just does the linting). ES6 support on the formatter is poor at the moment. PRs and new contributors welcome/wanted! @diasdavid if you have time can you move this issue over there? If not I can grab it later.

I've only had time to peck away at it slowly, and there are definitely going to be some upstream PRs needed to get full ES6 support.

@feross

This comment has been minimized.

Copy link
Member

commented Dec 25, 2015

Moved this issue: maxogden/standard-format#138

@feross feross closed this Dec 25, 2015

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.