Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

validateIndentation and multiple concatenated strings #247

Closed
kangax opened this Issue · 6 comments

3 participants

@kangax

validateIndentation works great for our entire codebase except for cases like this:

if (this.type === 'linear') {
  markup = [
    '<linearGradient ',
      'id="SVGID_', this.id,
      '" gradientUnits="', this.gradientUnits,
      '" x1="', coords.x1,
      '" y1="', coords.y1,
      '" x2="', coords.x2,
      '" y2="', coords.y2,
    '">'
  ];
}

I find this kind of arrangement reasonable; and it reads well. Is there anything we can do to make it play nice with JSCS? What would you suggest?

@kangax kangax referenced this issue in kangax/html-minifier
Merged

Enable JSHint's `quotmark` rule. #126

@jzaefferer

This is pretty similar to the rules for "Chained Method Calls" in the jQuery style guide, for example:

elements
    .addClass( "foo" )
    .children()
        .html( "hello" )
    .end()
    .appendTo( "body" );

Afaik its somewhat @mikesherov was working on.

@jzaefferer

See also #204

@mikesherov
Owner

Sorry, this is not something we intend on fixing, as it's literally indistinguishable from an error, unless you can suggest something @kangax ? Closing this for now until further discussion.

@mikesherov mikesherov closed this
@kangax

I can't think of anything else except ignoring entire block. Does JSCS have something like /* jshint ignore:start */ and /* jshint ignore:end */?

@mikesherov
Owner

@kangax it's on the roadmap. I'll try and prioritize that one because more than a few are asking for this, and it's pretty standard functionality.

@kangax

@mikesherov thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.