un-ts / eslint-plugin-sonar

ESLint rules extracted from SonarJS
https://github.com/SonarSource/SonarJS
MIT License
42 stars 2 forks source link

Some rules don't work without options #99

Open EvgenyOrekhov opened 1 year ago

EvgenyOrekhov commented 1 year ago

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:

  1. Use a default value. So "sonar/expression-complexity": "error" would implicitly use 3.
  2. 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.

JounQin commented 11 months ago

They're not controlled by us, the plugin re-exports rules from SonarJS, I think maybe some related documentation would be good enough.