diff --git a/package.json b/package.json index d1617d8f4..213ff0848 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,9 @@ "eslint --fix", "prettier --write", "git add" + ], + "yarn.lock": [ + "node ./scripts/yarn-lock-scan.js" ] } } diff --git a/scripts/yarn-lock-scan.js b/scripts/yarn-lock-scan.js new file mode 100644 index 000000000..0e44414ec --- /dev/null +++ b/scripts/yarn-lock-scan.js @@ -0,0 +1,10 @@ +const fs = require('fs'); +const path = require('path'); + +const yarnLockPath = './yarn.lock'; +const data = fs.readFileSync(path.resolve(yarnLockPath), 'utf8'); +if (data.match(/artifactory/g)) { + throw new Error( + 'Artifactory references in your yarn.lock! Please make sure you are using the official yarn or npm registry when downloading your dependencies!', + ); +}