clutchski / coffeelint

Lint your CoffeeScript.
http://www.coffeelint.org
Other
1.17k stars 172 forks source link

Unexpected indentation with chaining, 2.0.3 #620

Closed bazineta closed 6 years ago

bazineta commented 6 years ago

Assume that Fetch is an imported module, with a couple of useful functions, maps and fail.

The following will lint cleanly:

Fetch.maps()
.then (maps) -> # omitted for brevity
.done (maps) -> # omitted for brevity
.fail (error) -> # omitted for brevity

But the following will not, and results in an unexpected indentation error on the .fail line:

Fetch.maps()
.then (maps) -> # omitted for brevity
.done (maps) -> # omitted for brevity
.fail Fetch.fail

Basically, so long as the chained function is inline, it lints, but not if the function isn't inline.

This seems to be a regression; the issue doesn't occur in 1.16.0.

swang commented 6 years ago

Thanks. Published 2.0.5 to fix this issue.

bazineta commented 6 years ago

Tested with 2.0.5; still seeing the same issue. Here's a passing test:

    'click @ui.collapse': ->
      @getChildView('json').hide
        self: false
        tree: true
      return

But this one will fail on the .search line:

    'change @ui.search': ->
      @getChildView('json')
        .hide
          self: false
          tree: true
        .search @ui.search.val()
      return
swang commented 6 years ago

published 2.0.6 to address this issue

bazineta commented 6 years ago

Resolved. Thanks!