sterpe / coffee-fmt

gofmt for coffee
MIT License
9 stars 4 forks source link

coffee-fmt turns working coffeescript into broken coffescript #12

Closed dholth closed 9 years ago

dholth commented 9 years ago

Using coffee-fmt 0.7.0, the following input generates the following output. Unfortunately the output is not syntactically valid. Instead, it would be preferable if coffee-fmt generated valid coffeescript.

module.exports = ($q) ->
  new class
    get: () ->
      $q (resolve) =>
        resolver = (v) -> v
      try
        resolve null
      catch err
        resolve null
module.exports = ($q) ->
    new class
        get : () ->
            $q(resolve)=>
                resolver = (v) -> v
            try
                resolve null
            catcherr
                resolve null
sterpe commented 9 years ago

I'm going to close this issue.

In fact, coffee-fmt correctly formats a large subset of coffee script correctly and it does it a hell of a lot better than the other package out there, which you are also welcome to try.

That being said, obviously there are bugs and omissions. Uninformative and snarky-titled issue reports like this don't help me and they misinform others who may be perusing the repository issues.

Unfortunately, I don't really have much time to dedicate to this project and, personally believe that ES6 Harmony renders coffee-script a moot point going forward. There are therefore three routes available to you: contribute a fix, code around the limitations of the tool, or stop using the tool completely.

Finally, I think it's important to reiterate that this is OSS -- no guarantee of warranty of suitability for any purpose is expressed or implied, including suitability for formatting coffee-script.

If you would like to refile a specific issue about catcherr formatting incorrectly, feel free and, as always, I will gladly accept PRs that address any issues you have discovered.

dholth commented 9 years ago

I'm sorry that you found it snarky. I know that open source can be a thankless job. I am also really looking forward to using ES6 instead.