From 27f3a1c614e7a67ba89fb31e254b4123fbdba69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20B=C5=82a=C5=BCejewicz?= Date: Sun, 21 Nov 2021 11:52:49 +0100 Subject: [PATCH] Add new packages to allowed names in npm banned types The assertion is not a rule, so it cannot be bypassed in DT config. - 'download-git-repo' - 'download-package-tarball' Both are published to NPM registry already. Required for: DefinitelyTyped/DefinitelyTyped#56874 DefinitelyTyped/DefinitelyTyped#56875 Thanks! /cc @LinqLover --- src/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2b57b51..04a907b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -237,9 +237,13 @@ function assertPathIsInDefinitelyTyped(dirPath: string): void { function assertPathIsNotBanned(dirPath: string) { const basedir = basename(dirPath); if (/(^|\W)download($|\W)/.test(basedir) && - basedir !== "download" && - basedir !== "downloadjs" && - basedir !== "s3-download-stream") { + ![ + "download-git-repo", + "download-package-tarball", + "download", + "downloadjs", + "s3-download-stream", + ].includes(basedir)) { // 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.`); }