What's the first variable in ESLint's max-len settings?

ESLint setting max-len allows you to enter two required parameters:

  • The total number of characters allowed for each line of code. This character is indented.
  • A character number to use when a tab character is encountered.

However, when I look at the code they provide, this:

"max-len": [2, 80, 4]

      

... or three parameters. Above this, they link to a 2 digit tab, which they show as:

"max-len": [1, 80, 2]

      

I am assuming that the second and third options specify valid common characters (in this case 80) and the length of the tab (2 or 4). What is the first option [1,...

or the [2,...

defining one?

+3


source to share


1 answer


The first element of the array is the rule identifier, which essentially turns the rule on or off. All other elements of the array are passed to the rule as parameters.

In the official documentation , the rule identifier can be one of three values:



0 - disable the rule 1 - enable the rule as a warning (does not affect the exit code)
2 - enable the rule as an error (exit code 1 if triggered)

+10


source







All Articles