clutchski/coffeelint

Unexpected indentation with chaining, 2.0.3

Closed this issue · 4 comments

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

Thanks. Published 2.0.5 to fix this issue.

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

published 2.0.6 to address this issue

Resolved. Thanks!