clutchski / coffeelint

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

Add failing tests for indentation lint bug #603

Closed adam-h closed 7 years ago

adam-h commented 7 years ago

This test shows a bug introduced in 1.16.1 (not existent in 1.16.0). Only seems to happen based on using the prop function in some instances:

# OK
$('<input>')
  .prop('placeholder', $el.prop('placeholder'))

# OK
$('<input>')
  .prop('placeholder', @$el.attr('placeholder'))

# Fails
$('<input>')
  .prop('placeholder', window.prop('placeholder'))

# Fails
$('<input>')
  .prop('placeholder', @$el.prop('placeholder'))

# ---

# OK
$("body")
  .addClass("alpha--" + beta)
  .addClass("charlie")

# Fails
$("body")
  .addClass("alpha--" + beta).addClass("charlie")

Both issues are regressions as they worked in 1.16.0. Not sure as to the fix, but there was a large refactor of the indentation in 1.16.1

swang commented 7 years ago

Thanks. I'll revert to previous version once I get back. Apologies.

On Jul 4, 2017, at 9:09 PM, Adam Heath notifications@github.com wrote:

This test shows a bug introduced in 1.16.1 (not existent in 1.16.0). Only seems to happen based on using the prop function in some instances:

OK

$('') .prop('placeholder', $el.prop('placeholder'))

OK

$('') .prop('placeholder', @$el.attr('placeholder'))

Fails

$('') .prop('placeholder', window.prop('placeholder'))

Fails

$('') .prop('placeholder', @$el.prop('placeholder'))

---

OK

$("body") .addClass("alpha--" + beta) .addClass("charlie")

Fails

$("body") .addClass("alpha--" + beta).addClass("charlie") Both issues are regressions as they worked in 1.16.0. Not sure as to the fix, but there was a large refactor of the indentation in 1.16.1

You can view, comment on, or merge this pull request online at:

https://github.com/clutchski/coffeelint/pull/603

Commit Summary

Add failing test for indentation lint bug File Changes

M test/test_indentation.coffee (22) Patch Links:

https://github.com/clutchski/coffeelint/pull/603.patch https://github.com/clutchski/coffeelint/pull/603.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.