-
-
Notifications
You must be signed in to change notification settings - Fork 213
Open
Description
Describe the bug
jscpd
cli auto run when I only use Node API. Because the product file contains self-running code
To Reproduce
When I tested it with the following code, I found that jscpd always scanned node_modules
. This was completely different from my configuration.
After much debugging, I found that jscpd
runs once on the file itself, without any args, so it scanned the entire directory.
const { detectClones } = require('jscpd');
(async () => {
const clones = await detectClones({
path: ['./src'],
threshold: 5,
ignore: ['**/apis/**'],
blame: true,
});
console.log(clones);
})();
This was a disaster of side effects, and I had no way to cleanly integrate the functionality I needed using the Node API exported by jscpd
.
Expected behavior
When using the node api, do not have self-running side effects.
GrinZero and nanianlisao
Metadata
Metadata
Assignees
Labels
No labels