mysticatea / eslint-plugin-node

Additional ESLint's rules for Node.js
MIT License
959 stars 170 forks source link

[no-extraneous-require] should throw even when package is not installed #298

Open dangh opened 3 years ago

dangh commented 3 years ago

Hello,

This is covered by no-missing-require which we don't use.

In our case, we have a monorepo with ESlint configured at top level for all packages. We only work with some of it at a time so there are dozen packages that doesn't need to be npm installed. It make sense for us to disable no-missing-require and leave it to the deployment.

This commit checks for target.filePath which is null if the package is not installed, so if the package isn't installed locally it will pass. I don't think it's desired.

What do you think?