-
Notifications
You must be signed in to change notification settings - Fork 180
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
JS-597 Remove dependency on sonar-runtime to determine if rule has secondaries #5160
Conversation
|
schema: [ | ||
{ | ||
// internal parameter for rules having secondary locations | ||
enum: ['sonar-runtime'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we remove the capability for external custom rules to have secondaries. As far as I see, ucfg's don't use it, architecture doesn't use it.
@@ -26,7 +27,8 @@ public void define(Context context) { | |||
EslintRulesBundle.class, | |||
CustomRulesDefinition.class, | |||
RuleRepository.class, | |||
TsRepository.class | |||
TsRepository.class, | |||
AnalysisMode.class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this, locally for me it was crashing
const sonarOptions = { | ||
type: 'string', | ||
enum: [SONAR_RUNTIME, 'metric'], // 'metric' only used by S3776 | ||
enum: ['sonar-runtime', 'metric'], // 'metric' only used by S3776 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why I changed that but in next PR, it will be fully removed.
What is the purpose of this property? If every rule has a property named |
@ericmorand-sonarsource - we can't easily change all of the rules to be encoded into a common format. We would need to update all of the external rules that call eslint.report directly. At least that's how I see it right now. |
@zglicz good point, thanks. |
JS-597
First step to remove using 'sonar-runtime' from adding it to rules. Here, we stop depending on it to decode the rule.
We introduce a new property in the rule meta, i.e. SXXXX/meta.ts called
hasSecondaries
. This will indicate if the rule has the capability to produce secondaryLocations.