False positives for rule typescript:S2814 with const and type

Since a few days we have a lot of code smells in one of our projects. Apparently the rule typescript:S2814 has been updated and it now detects the following code as smell:

export const SET_COUNTRY_ACTION = 'SET_COUNTRY_ACTION';
export type SET_COUNTRY_ACTION = typeof SET_COUNTRY_ACTION;

Is there any specific reason that this is detected as a redeclaration? Because one is a constant and the other a type, I think this should not be reported as an error.

Hello @Florian_Eckerstorfer,

Welcome to SonarSource community, and thank you for reaching out!

Indeed, the rule should distinguish value exports from type exports.

I created a ticket to address that issue as soon as possible.

Best,
Yassin

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.