Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove error on redundant isolatedModules/verbatimModuleSyntax combination #53611

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4257,9 +4257,6 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
if (moduleKind === ModuleKind.AMD || moduleKind === ModuleKind.UMD || moduleKind === ModuleKind.System) {
createDiagnosticForOptionName(Diagnostics.Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System, "verbatimModuleSyntax");
}
if (options.isolatedModules) {
createRedundantOptionDiagnostic("isolatedModules", "verbatimModuleSyntax");
}
if (options.preserveValueImports) {
createRedundantOptionDiagnostic("preserveValueImports", "verbatimModuleSyntax");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.


!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
==== input.js (0 errors) ====
x;
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.


!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
!!! error TS5107: Option 'target=ES3' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
==== input.js (0 errors) ====
x;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functi
error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
Use 'verbatimModuleSyntax' instead.
error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
error TS5104: Option 'preserveValueImports' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
error TS5105: Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'.

Expand All @@ -15,7 +14,6 @@ error TS5105: Option 'verbatimModuleSyntax' cannot be used when 'module' is set
!!! error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
!!! error TS5101: Use 'verbatimModuleSyntax' instead.
!!! error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
!!! error TS5104: Option 'preserveValueImports' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
!!! error TS5105: Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'.
==== tests/cases/conformance/externalModules/verbatimModuleSyntaxCompat.ts (0 errors) ====
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/tsconfig.json(4,9): error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
/tsconfig.json(5,9): error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.
/tsconfig.json(5,9): error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
Use 'verbatimModuleSyntax' instead.
Expand All @@ -8,13 +7,11 @@
/tsconfig.json(6,9): error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'.


==== /tsconfig.json (6 errors) ====
==== /tsconfig.json (5 errors) ====
{
"compilerOptions": {
"verbatimModuleSyntax": true,
"isolatedModules": true,
~~~~~~~~~~~~~~~~~
!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
"preserveValueImports": true,
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/tsconfig.json(4,9): error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
/tsconfig.json(5,9): error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.
/tsconfig.json(5,9): error TS5101: Option 'preserveValueImports' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
Use 'verbatimModuleSyntax' instead.
Expand All @@ -8,13 +7,11 @@
/tsconfig.json(6,9): error TS5104: Option 'importsNotUsedAsValues' is redundant and cannot be specified with option 'verbatimModuleSyntax'.


==== /tsconfig.json (6 errors) ====
==== /tsconfig.json (5 errors) ====
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"isolatedModules": true,
~~~~~~~~~~~~~~~~~
!!! error TS5104: Option 'isolatedModules' is redundant and cannot be specified with option 'verbatimModuleSyntax'.
"preserveValueImports": true,
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS5095: Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later.
Expand Down