standard / atom-standard-formatter

Atom package to format code using Javascript Standard Style.
https://atom.io/packages/standard-formatter
MIT License
35 stars 19 forks source link

Read parser option from package.json #61

Open oomathias opened 7 years ago

oomathias commented 7 years ago

Using this file

import React from 'react';;;;

export default class extends React.Component {
  static ping = 'pong'
}

is not fixed on save (invoking manually ./node_modules/.bin/standard --fix does fix the file);

import React from 'react';;;;

export default class extends React.Component {}

is fixed on save.

Maybe it's related to my parser:

"standard": {
    "parser": "babel-eslint",
    ...
}
joseluisq commented 7 years ago

v2.8.0

captura de pantalla de 2017-01-11 09-04-25

oomathias commented 7 years ago

@joseluisq Well, if you change the parser to babel-eslint the linter-js-standard package works well and I'm not seeing any errors (I suppose you are using this one in the screenshot). Also, invoking manually standard --fix works too.

"standard": {
  "parser": "babel-eslint"
}

The documentation says:

standard - equivalent to running standard --fix

Actually, it's not the case if you use another parser.

joshpitzalis commented 7 years ago

+1

tehfailsafe commented 7 years ago

Any resolution on this? Also fails when using decorators.