Angular 6, SonarQube: src folder not ignored while checking package.json

Viewed 2308

I’m using SonarQube (Version 6.7.5) for my Angular 6 Project and want to deal with the following code smell:

“Module ‘src’ is not listed as dependency in package.json”

There are many imports throughout the project like “import … from ‘src/app/…’;” I added the following rule to my tslint.json:

“no-implicit-dependencies”: [true, [“src”, “app”]]

but no success. How can I best solve this code smell?

1 Answers

As Henry said. Use relative paths. I changed from src/... starting absolute paths to relative paths and it fixed it.

I'm using Angular 6 also.

Related