Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert JSHint rules to Sonar

Some of our dev groups are using JSHint for code quality and we are looking to adopt SonarQube for greater transparency. Sonar explained they want to maintain their own rules list here: The Sonarway

Is there a way to easily map existing JSHint rules into the "Sonarway" equivalents? We'd like to maintain 1 set of rules for JS.

like image 933
Marcus F Avatar asked Apr 28 '15 20:04

Marcus F


1 Answers

It depends what you mean with mapping. JSHint has a list of built-in rules, some of which your developers will have enabled.

For each of the rules they have enabled, they'll need to find the equivalent in the SonarQube list of rules. (I'd suggest making a shared spreadsheet, so this lookup only needs to happen once.)

Should there be any rules that don't have a SonarQube equivalent yet, they will need to write such a rule themselves. Here is an example rule. The code will probably be similar to what JSHint uses internally; however, JSHint does not have separate files per rule.

like image 113
Ruben Verborgh Avatar answered Nov 14 '22 02:11

Ruben Verborgh