Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some rules don't work without options #99

Open
EvgenyOrekhov opened this issue Jul 19, 2023 · 1 comment
Open

Some rules don't work without options #99

EvgenyOrekhov opened this issue Jul 19, 2023 · 1 comment

Comments

@EvgenyOrekhov
Copy link

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
Copy link
Member

JounQin commented Dec 27, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants