From 3af3a1b7716799da7e604ffe3a3e5c1d5b65d97f Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Wed, 16 Sep 2020 00:37:30 -0400 Subject: [PATCH] fix: allowJs and checkJs shouldn't be relatedTo emitDeclarationOnly - remove emitDeclarationOnly from their relatedTo and group them separately from declaration by adding a newline - these only seem quite loosely related, only by the DTS/JS doc - c.f. https://github.com/microsoft/TypeScript-Website/blob/2a57f7116b72217e47550657826cd650d258ba20/packages/documentation/copy/en/javascript/Creating%20DTS%20files%20From%20JS.md#L46 - the relationship is not even mentioned in their notes or otherwise in the Reference, which was very confusing to me - the commit that adds this relationship seems to put `emitDeclarationOnly` elsewhere too, so maybe this was a mistake? - c.f. https://github.com/microsoft/TypeScript-Website/commit/4627aa39a0fed1722b71cc7e00a79ec11a12f8cd#diff-a912c6af3a16bf4288093c1264955bc6R75 --- packages/tsconfig-reference/scripts/tsconfigRules.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/tsconfig-reference/scripts/tsconfigRules.ts b/packages/tsconfig-reference/scripts/tsconfigRules.ts index b2b99b02f76a..a1b3f22afd4f 100644 --- a/packages/tsconfig-reference/scripts/tsconfigRules.ts +++ b/packages/tsconfig-reference/scripts/tsconfigRules.ts @@ -76,8 +76,9 @@ export const relatedTo: [AnOption, AnOption[]][] = [ ["noLib", ["lib"]], - ["allowJs", ["checkJs", "emitDeclarationOnly"]], - ["checkJs", ["allowJs", "emitDeclarationOnly"]], + ["allowJs", ["checkJs"]], + ["checkJs", ["allowJs"]], + ["declaration", ["declarationDir", "emitDeclarationOnly"]], ["moduleResolution", ["module"]],