ESLint's max-len setting allows me to input two required options:
However, when I look at the code they provide, it's:
"max-len": [2, 80, 4]
...or three options. Above this they reference a 2-character tab, which they show as:
"max-len": [1, 80, 2]
I assume the second and third options set the total characters allowed (80 in this case) and the length of a tab (2 or 4). What is the first option [1,...
or [2,...
defining?
The first item in the array is the rule ID, which essentially turns the rule on or off. All remaining items in the array are passed to the rule as options.
Per the official documentation, a rule ID may be one of three values:
0 - turn the rule off
1 - turn the rule on as a warning (doesn't affect exit code)
2 - turn the rule on as an error (exit code is 1 when triggered)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With