royriojas / esformatter-jsx

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

Decorators formatting bug when using esformatter-asi #74

Open arminrosu opened 8 years ago

arminrosu commented 8 years ago

Hi,

Thanks again for fixing inline decorators :).

Found a new edges case where esformatter-jsx behaves unexpected:

.esformatter

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

    ]
}

Input

@Decorator
export default class Example {
    constructor() {
        var a = '';
    }
}

Output

@Decorator /*__decorator__semi__open*/
/*__decorator__semi__end*/
export default class Example {
  constructor() {
    var a = ''
  }
}

I'm not sure if asi adds characters which break the replacement or there is another issue.

royriojas commented 8 years ago

Hi @arminrosu, sorry for this issue.

Yes we do have some issues with the interop with other esformatter plugins.

arminrosu commented 8 years ago

As far as bugs go, this is one I can certainly live with. esformatter-jsx is a really useful project. I especially appreciate that you stay involved. Thank you!