Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Exempt existing packages from download forbidden word
Browse files Browse the repository at this point in the history
  • Loading branch information
sandersn committed Feb 8, 2019
1 parent 5459940 commit ad7eb60
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229,
"sourceMaps": true
},
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${file}"
}
]
}
5 changes: 4 additions & 1 deletion src/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export async function checkPackageJson(
}
return;
}
if (/download/.test(dirPath)) {
if (/download/.test(dirPath) &&
dirPath !== "download" &&
dirPath !== "downloadjs" &&
dirPath !== "s3-download-stream") {
// Since npm won't release their banned-words list, we'll have to manually add to this list.
throw new Error(`${dirPath}: Contains the word 'download', which is banned by npm.`);
}
Expand Down

0 comments on commit ad7eb60

Please sign in to comment.