Adding "TODO, FixMe comments" rule to TypeScript

Just curious if there’s a way to add an existing rule from one language to another? Some of the languages have a rule to search for “TODO, FixMe comments”, which seems general enough to work with any language, but this rule isn’t available for TypeScript. Is there a way that we can add this rule to TypeScript (Code Smell)?


Welcome to the community!

You’ve posted this in the ‘Writing rules’ category, so I guess you’re willing to do the work yourself. But unfortunately, TypeScript isn’t a language where we support custom rules. So unfortunately you would have to implement it outside of SonarQube, run the tool before analysis, convert its output to the Generic Issue Report format (it it wasn’t already in that format) and import the report during analysis.

And I’m going to ping the language team so they’re aware of the interest in writing custom rules for TS.


Hey U84six,

Rule S1135 is available for JS and TS. Would you be interested in the S1707 rule which checks if someone is referenced or did you have something else in mind?