Define custom rules for Node.js build tools

Hi,

due to the recent NPM attacks we decided to have centralized configuration files for the Node.js build tools like NPM (.npmrc), Yarn (.yarnrc, .yarnrc.yml) and PNPM (pnpm-workspace.yaml). As these may be overridden on project level, we thought about defining custom rules for these files to make sure, certain settings are not changed.

Is there a way to define rules on yml-files? Is there any other way to check for such changes?

We are using SonarQube Server 2025.4.2, soon updating to 2025.6.1.

Thanks!

Regards,

Carsten

Hi Carsten,

There are 3 rules for YAML, but nothing that would be helpful in this context.

I’m going to flag this need for the PMs.

 
Ann

1 Like