typescript:S7718 Unused Error parameters in catch clauses

The rule for error parameter naming does not consider the unused case of the parameter. When the parameter is unused inside the error handling, it needs to follow different conventions which violate this error naming rule, e.g. they need a _ prefix.

Please consider the unused parameter or make the pattern configurable.

1 Like

Hi,

Can you remind me of your context for this? I.e. are you on SonarQube Cloud? SonarQube for IDE (flavor and version)? SonarQube self-managed (flavor and version)?

 
Thx,
Ann

Sorry its a 2025.5.1 sonarqube server instance. But i guess the lack of rule flexibility is independent from that.

Hi,

Thanks. I just need to make sure you’re seeing this in a (relatively) current version. I’ve flagged this for the language experts.

 
Ann

Hi Michael,

Thank you for the feedback! You have perfect timing, we actually just implemented these exact changes for the next version of the analyzer.

The rule will now automatically ignore variables starting with an underscore (_) or common names like error, cause, etc. We have also added a setting so you can provide your own list of names to ignore.

These updates are currently in development and will be available in a future version of SonarQube Server once the next release is out.

François

1 Like