For example, "sonar/expression-complexity": "error" doesn't work, but "sonar/expression-complexity": ["error", 3] does.
That wasn't obvious to me.
I think there are 2 ways to improve this:
Use a default value. So "sonar/expression-complexity": "error" would implicitly use 3.
Make options required. So "sonar/expression-complexity": "error" would fail validation, and ESLint would throw a config validation error, like Configuration for rule "sonar/expression-complexity" is invalid: value is required.
Note: I used sonar/expression-complexity rule as an example, but there may be other rules that have the same problem.
For example,
"sonar/expression-complexity": "error"
doesn't work, but"sonar/expression-complexity": ["error", 3]
does. That wasn't obvious to me.I think there are 2 ways to improve this:
"sonar/expression-complexity": "error"
would implicitly use3
."sonar/expression-complexity": "error"
would fail validation, and ESLint would throw a config validation error, likeConfiguration for rule "sonar/expression-complexity" is invalid: value is required
.Note: I used
sonar/expression-complexity
rule as an example, but there may be other rules that have the same problem.