Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Indentation in objects with chained function call is not accepted #713

adrianheine opened this Issue Oct 25, 2012 · 4 comments


None yet
4 participants

The following code gives me indentation errors on the last two lines:

/*jshint indent: 2*/
/*jslint indent: 2*/
var x = {
  prop1: chainable
      foo: null

  prop2: null

Apparently JSHINT expects these two lines to be indented one step further. Note that this seems to be a minimal example, so the object literal parameter for chaincall seems to be part of the problem.


Shutnik commented Feb 28, 2013

+1 for that!

Another test case:

/*jshint indent:4*/

            four: true // Expected 'four' to have an indentation at 5 instead at 13. WTF?

@valueof valueof closed this in 30c0019 Mar 27, 2014


Shutnik commented Mar 27, 2014

What an elegant solution :-)


valueof commented Mar 27, 2014


gtanner commented Sep 16, 2014

I find the line breaking in the above examples a little weird: Changed to:

var x = {
  prop1: chainable.chaincall({
    foo: null
  prop2: null

/*jshint indent:4*/
    four: true // Expected 'four' to have an indentation at 5 instead at 13. WTF?

The both work fine (and pass lint with 2.4.4).

I only break lines (and indent) on { which serves me well

@jugglinmike jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

@valueof @jugglinmike valueof + jugglinmike Remove code for enforcing indentation.
Option 'indent' still exists, though, for correct character reporting.

Closes #1583
Closes #999
Closes #1085
Closes #1467
Closes #1404
Closes #713
Closes #428
Closes #1369
Closes #1254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment