Skip to content

Commit 7963022

Browse files
committed
Review feedback
1 parent 4475d81 commit 7963022

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/compiler/commandLineParser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,14 @@ namespace ts {
465465
{
466466
name: "allowSyntheticDefaultImports",
467467
type: "boolean",
468+
affectsSemanticDiagnostics: true,
468469
category: Diagnostics.Module_Resolution_Options,
469470
description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking
470471
},
471472
{
472473
name: "esModuleInterop",
473474
type: "boolean",
475+
affectsSemanticDiagnostics: true,
474476
showInSimplifiedHelpView: true,
475477
category: Diagnostics.Module_Resolution_Options,
476478
description: Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports

src/compiler/utilities.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6972,13 +6972,8 @@ namespace ts {
69726972
return false;
69736973
}
69746974

6975-
for (const option of optionDeclarations) {
6976-
if ((option.strictFlag && getStrictOptionValue(newOptions, option.name as StrictOptionName) !== getStrictOptionValue(oldOptions, option.name as StrictOptionName)) ||
6977-
(option.affectsSemanticDiagnostics && !newOptions[option.name] !== !oldOptions[option.name])) {
6978-
return true;
6979-
}
6980-
}
6981-
return false;
6975+
return optionDeclarations.some(option => (!!option.strictFlag && getStrictOptionValue(newOptions, option.name as StrictOptionName) !== getStrictOptionValue(oldOptions, option.name as StrictOptionName)) ||
6976+
(!!option.affectsSemanticDiagnostics && !newOptions[option.name] !== !oldOptions[option.name]));
69826977
}
69836978

69846979
export function hasZeroOrOneAsteriskCharacter(str: string): boolean {

0 commit comments

Comments
 (0)