Version
SonarQube Version 8.4.2 (build 36762)
Error observed and steps to reproduce
My TypeScript project uses absolute imports. We have just added SonarQube to our org, and it is reporting code smells for all of our internal module imports as:
import MyComponent from 'components/MyComponent';
import { Some, Other, Components } from 'components/SomeOtherComponents';
import { helperFcn } from 'lib/utils';
etc
SonarQube insists:
Either remove this import or add it as a dependency.
Dependencies should be explicitly listed in the package.json file. Importing a module that is not declared as a dependency makes it an implicit one and is bound to create problems.
potential workaround
Mark as false positive
questions
Is there a way to whitelist internal modules for imports, as you can with eslint, or do I have to manually mark all of these as false positives as they come up?
Thank you!