with java and php custom rules, I can monitor if these rules are added or not to a project custom quality profile, and then I can have stats on the validation/violation of these rules.
I’m not sure you can; this isn’t a need we anticipated. Would you mind sharing your use case?
Thanks for sharing. I’m going to move this to the ‘Suggest new features’ category, since what you’re after doesn’t currently exist.
Well, it actually does exist. It’s just marked as deprecated since Sonarqube 6
I’m talking about SonarJs custom rules which allow all this.
The question, regarding this need, is still why was it considered “deprecated”, and can this “deprecation” (which never transformed into a removing of the feature) be canceled ?
hello @Tristan107 ,
custom rules are deprecated because they were using now removed Java based parser (the feature is really gone). We now use parser based on ESLint. I think we will eventually introduce JS based custom rules, but it’s not on the roadmap right now. You can find some infrastructure for this if you dig in the code, but there are some important pieces still missing.
Oh, ok I didn’t know it was already removed.
The question is indeed why remove the java based parser if it removes rules from UI and make them not visible through quality profiles and APIs :
hello @Tristan107 ,
it seems that my explanation just caused more confusion, sorry for that
We use ESLint as internal library, not directly. All the rules are now implemented using ESLint internally, some of the rules are just plain ESLint rules, some of them we developed ourselves using ESLint framework (usually the more sofisticated rules with data flow analysis are like this).
Java rules had to be removed because maintaining the parser was too much work and did not add any value. Writing rules for JS in JS will allow us to innovate more.
can we do that too, create a rule in ESLint and make it visible in UI like it seems you do ?
eventually perhaps yes, but for the time being this is not possible