FR: Inline configuration, to comment out rules temporarily, like JSHint #223

Closed
pickhardt opened this Issue Jan 30, 2014 · 8 comments

Comments

Projects
None yet
7 participants

Request for inline configuration a la JSHint:
http://jshint.com/docs/

Example:

    /* jscs maximumLineLength: 250 */
    return /^realyreallyreallyreallyreallyreallyreallyreallylongregex$/.test(s);
    /* jscs maximumLineLength: 80 */
@ghost

ghost commented Feb 19, 2014

+1

Contributor

jzaefferer commented Feb 25, 2014

This seems like a bad idea. If you really need exceptions, your suggestion in #224 seems a little more sane (though that should be a separate ticket).

I would like this ability. For instance, I want to set requireCamelCaseOrUpperCaseIdentifiers: true, but sometimes I'm interacting with third party libraries that don't follow this convention, so I need to do it. For instance,

Foundation.set_namespace = _.noop;

jshint has the ability to temporarily turn rules off as well.

Mithgol commented Apr 21, 2014

Why is this issue labeled cli?

@mikesherov mikesherov added this to the 1.6 milestone Jun 24, 2014

@mikesherov mikesherov removed the cli label Jun 24, 2014

@mikesherov mikesherov modified the milestone: 1.6 Jun 24, 2014

Contributor

mikesherov commented Jun 30, 2014

Thanks fior the discussion, folks. What we're going to do is three-fold:

  1. Ability to disable and re-enable all rules on a per line basis: e.g. // jscs ignore:start and // jscs ignore:end
  2. Ability to disable and re-enable any rules on a per line basis: e.g. // jscs requireSpaces: false and // jscs requireSpaces: true
  3. Ability to define override rules at the beginning of the file: /* jscs maximumLineLength: 200 */

Therefore, this request falls outside the scope here, so closing it. Thanks!

@mikesherov mikesherov closed this Jun 30, 2014

@mikesherov Did this make it in?

Thanks! Was searching for 'ignore' when I should have been searching for 'disable'. Appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment