royriojas / esformatter-jsx

esformatter plugin: format jsx files (or js files with Facebook React JSX Syntax)
MIT License
142 stars 25 forks source link

Support decorator on same line as property #73

Closed arminrosu closed 8 years ago

arminrosu commented 8 years ago

Hello,

We are using a lot of decorators with properties, on the same line. e.g.

export default class DecoratorTest {
    @readonly width = 100;
}

Unfortunately, this throws an error: Unexpected token (2:62). Adding a line break between them fixes this issue. It would be nice if it could either format it itself or leave it as it is.

Here is my .esformatter:

{
    "preset": "default",
    "root": true,
    "indent": {
        "value": "  "
    },
    "plugins": [
        "esformatter-jsx"
    ]
}

Last but not least, thanks for this great plugin!

royriojas commented 8 years ago

Hi @arminrosu, yes I noticed that issue when starting using mobx...

Will fix it!

arminrosu commented 8 years ago

Awesome, thanks :)