angular-styleguide icon indicating copy to clipboard operation
angular-styleguide copied to clipboard

JSCS `maximumLineLength` vs Jshint `maxlen`

Open O-Mutt opened this issue 10 years ago • 6 comments

"maximumLineLength": {
      "value": 100,
    },

vs

"maxlen": 120,

this seems to cause a discrepancy. I am not well versed enough in these two frameworks but in my fork of this styleguide i consolidated the two of them. I got jshint working in grunt saw the errors, fixed them, then got jscs running but noticed the same lines failing.

O-Mutt avatar Nov 17 '15 20:11 O-Mutt

hmmm, looks like maxlen is deprecated

We recently removed the camelcase rule from the JSHint settings (#502) in a similar case where JSHint and JSCS rules were redundant, and should probably do the same here.

I suggest we use the lower of the two values: "100".

I can do a PR in the next couple days, but of course someone should feel free to beat me to it

zachlysobey avatar Nov 17 '15 22:11 zachlysobey

I was going through the options suggested a couple days ago and noticed that a few were deprecated. I intended to make a pull request that replaced them with the appropriate JSCS option, if possible, but I hadn't gotten around to it yet.

Here are the ones I identified, along with the JSCS equivalent, if I happened to know it.

  • immed (requireParenthesesAroundIIFE)
  • indent (validateIndentation)
  • newcap
  • maxlen (maximumLineLength)
  • noempty (disallowEmptyBlocks)
  • quotmark (validateQuoteMarks)
  • esnext
  • laxbreak
  • laxcomma
  • multistr

mattgrande avatar Nov 18 '15 15:11 mattgrande

Nice. Let me know if you get started; and I'll do the same. I'd like to make these changes myself ;-)

zachlysobey avatar Nov 18 '15 15:11 zachlysobey

I just submitted a PR (#595) which handles maxlen and a many more of the deprecated rules.

New "TODO" list:

zachlysobey avatar Nov 21 '15 15:11 zachlysobey

Once merged, PR #595 closes this issue.

zachlysobey avatar Nov 28 '15 18:11 zachlysobey

PR never merged ... would love to get this in if anyone wants to make a new PR

johnpapa avatar Sep 05 '16 18:09 johnpapa