Problem analyzing TS code - import module from alias

Hi Team,

We’re using SonarQube DC edition 7.9.2.30863, SonarTS plugin 1.9.3766

We analyse TS code with imports from aliases (e.g. 'import something from ‘$entities/issues/utils’) and SonarQube says that $entities is not in package.json, though it is an alias, not the module itself and it shouldn’t be there. We suppose that such import from alias shouldn’t be considered a problem

Hi @nickl,

Welcome to SonarSource community :wave:

I believe you may be encountering the same issue here: JavaScript/TypeScript false positive with absolute imports A workaround is listed in there to whitelist those modules in the S4328 rule.

The issue was also reported here: Typescript S4328 does not support aliases #1851 and fixed with SonarJS 6.3. You should upgrade to SonarQube 8.5 or higher to get this fix then.

Joe

1 Like

Hi Joe! Thanks a lot, it seems to be our case.

1 Like