diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index ce2cf13a63..c32a381896 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -144,7 +144,7 @@ func (p *fileLoader) toPath(file string) tspath.Path { func (p *fileLoader) addRootTask(fileName string, libFile *LibFile, includeReason *FileIncludeReason) { absPath := tspath.GetNormalizedAbsolutePath(fileName, p.opts.Host.GetCurrentDirectory()) - if core.Tristate.IsTrue(p.opts.Config.CompilerOptions().AllowNonTsExtensions) || slices.Contains(p.supportedExtensions, tspath.TryGetExtensionFromPath(absPath)) { + if p.opts.Config.CompilerOptions().AllowNonTsExtensions.IsTrue() || tspath.HasExtension(absPath) { p.rootTasks = append(p.rootTasks, &parseTask{ normalizedFilePath: absPath, libFile: libFile, diff --git a/internal/compiler/filesparser.go b/internal/compiler/filesparser.go index ed12291585..64a2c8dcd7 100644 --- a/internal/compiler/filesparser.go +++ b/internal/compiler/filesparser.go @@ -8,6 +8,7 @@ import ( "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/diagnostics" "github.com/microsoft/typescript-go/internal/module" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" @@ -31,6 +32,7 @@ type parseTask struct { typeResolutionsInFile module.ModeAwareCache[*module.ResolvedTypeReferenceDirective] typeResolutionsTrace []module.DiagAndArgs resolutionDiagnostics []*ast.Diagnostic + processingDiagnostics []*processingDiagnostic importHelpersImportSpecifier *ast.Node jsxRuntimeImportSpecifier *jsxRuntimeImportSpecifier @@ -61,6 +63,34 @@ func (t *parseTask) load(loader *fileLoader) { return } + if tspath.HasExtension(t.normalizedFilePath) { + compilerOptions := loader.opts.Config.CompilerOptions() + allowNonTsExtensions := compilerOptions.AllowNonTsExtensions.IsTrue() + if !allowNonTsExtensions { + canonicalFileName := tspath.GetCanonicalFileName(t.normalizedFilePath, loader.opts.Host.FS().UseCaseSensitiveFileNames()) + supported := false + for _, ext := range loader.supportedExtensions { + if tspath.FileExtensionIs(canonicalFileName, ext) { + supported = true + break + } + } + if !supported { + if tspath.HasJSFileExtension(canonicalFileName) { + t.processingDiagnostics = append(t.processingDiagnostics, &processingDiagnostic{ + kind: processingDiagnosticKindExplainingFileInclude, + data: &includeExplainingDiagnostic{ + diagnosticReason: t.includeReason, + message: diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option, + args: []any{t.normalizedFilePath}, + }, + }) + } + return + } + } + } + loader.totalFileCount.Add(1) if t.libFile != nil { loader.libFileCount.Add(1) @@ -319,6 +349,11 @@ func (w *filesParser) getProcessedFiles(loader *fileLoader) processedFiles { } file := task.file path := task.path + + if len(task.processingDiagnostics) > 0 { + loader.includeProcessor.processingDiagnostics = append(loader.includeProcessor.processingDiagnostics, task.processingDiagnostics...) + } + if file == nil { // !!! sheetal file preprocessing diagnostic explaining getSourceFileFromReferenceWorker missingFiles = append(missingFiles, task.normalizedFilePath) diff --git a/testdata/baselines/reference/submodule/compiler/checkJsFiles6.errors.txt b/testdata/baselines/reference/submodule/compiler/checkJsFiles6.errors.txt index ebd8b9890d..64ee1083a7 100644 --- a/testdata/baselines/reference/submodule/compiler/checkJsFiles6.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/checkJsFiles6.errors.txt @@ -1,6 +1,12 @@ error TS5052: Option 'checkJs' cannot be specified without specifying option 'allowJs'. +error TS6504: File 'a.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation !!! error TS5052: Option 'checkJs' cannot be specified without specifying option 'allowJs'. +!!! error TS6504: File 'a.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation ==== a.js (0 errors) ==== var x; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/checkJsFiles6.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/checkJsFiles6.errors.txt.diff deleted file mode 100644 index 52a665c1b5..0000000000 --- a/testdata/baselines/reference/submodule/compiler/checkJsFiles6.errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.checkJsFiles6.errors.txt -+++ new.checkJsFiles6.errors.txt -@@= skipped -0, +0 lines =@@ - error TS5052: Option 'checkJs' cannot be specified without specifying option 'allowJs'. --error TS6504: File 'a.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation - - - !!! error TS5052: Option 'checkJs' cannot be specified without specifying option 'allowJs'. --!!! error TS6504: File 'a.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation - ==== a.js (0 errors) ==== - var x; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsFileCompilationWithoutJsExtensions.errors.txt b/testdata/baselines/reference/submodule/compiler/jsFileCompilationWithoutJsExtensions.errors.txt new file mode 100644 index 0000000000..080685f444 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/jsFileCompilationWithoutJsExtensions.errors.txt @@ -0,0 +1,10 @@ +error TS6504: File 'a.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation + + +!!! error TS6504: File 'a.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +==== a.js (0 errors) ==== + declare var v; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsFileCompilationWithoutJsExtensions.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/jsFileCompilationWithoutJsExtensions.errors.txt.diff deleted file mode 100644 index aa5135ffa1..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsFileCompilationWithoutJsExtensions.errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.jsFileCompilationWithoutJsExtensions.errors.txt -+++ new.jsFileCompilationWithoutJsExtensions.errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File 'a.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation -- -- --!!! error TS6504: File 'a.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --==== a.js (0 errors) ==== -- declare var v; -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=esnext).errors.txt b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=esnext).errors.txt new file mode 100644 index 0000000000..7a843cb155 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=esnext).errors.txt @@ -0,0 +1,44 @@ +error TS6504: File '/node_modules/conditions/index.node.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/conditions/index.web.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation + + +!!! error TS6504: File '/node_modules/conditions/index.node.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/conditions/index.web.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +==== /node_modules/conditions/package.json (0 errors) ==== + { + "name": "conditions", + "version": "1.0.0", + "type": "module", + "main": "index.cjs", + "types": "index.d.cts", + "exports": { + ".": { + "node": "./index.node.js", + "default": "./index.web.js" + } + } + } + +==== /node_modules/conditions/index.node.js (0 errors) ==== + export const node = 0; + +==== /node_modules/conditions/index.node.d.ts (0 errors) ==== + export const node: number; + +==== /node_modules/conditions/index.web.js (0 errors) ==== + export const web = 0; + +==== /node_modules/conditions/index.web.d.ts (0 errors) ==== + export const web: number; + +==== /main.ts (0 errors) ==== + import { web } from "conditions"; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=esnext).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=esnext).errors.txt.diff deleted file mode 100644 index 6c7cacf0ed..0000000000 --- a/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=esnext).errors.txt.diff +++ /dev/null @@ -1,48 +0,0 @@ ---- old.bundlerConditionsExcludesNode(module=esnext).errors.txt -+++ new.bundlerConditionsExcludesNode(module=esnext).errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/node_modules/conditions/index.node.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/conditions/index.web.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation -- -- --!!! error TS6504: File '/node_modules/conditions/index.node.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/conditions/index.web.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --==== /node_modules/conditions/package.json (0 errors) ==== -- { -- "name": "conditions", -- "version": "1.0.0", -- "type": "module", -- "main": "index.cjs", -- "types": "index.d.cts", -- "exports": { -- ".": { -- "node": "./index.node.js", -- "default": "./index.web.js" -- } -- } -- } -- --==== /node_modules/conditions/index.node.js (0 errors) ==== -- export const node = 0; -- --==== /node_modules/conditions/index.node.d.ts (0 errors) ==== -- export const node: number; -- --==== /node_modules/conditions/index.web.js (0 errors) ==== -- export const web = 0; -- --==== /node_modules/conditions/index.web.d.ts (0 errors) ==== -- export const web: number; -- --==== /main.ts (0 errors) ==== -- import { web } from "conditions"; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=preserve).errors.txt b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=preserve).errors.txt new file mode 100644 index 0000000000..7a843cb155 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=preserve).errors.txt @@ -0,0 +1,44 @@ +error TS6504: File '/node_modules/conditions/index.node.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/conditions/index.web.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation + + +!!! error TS6504: File '/node_modules/conditions/index.node.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/conditions/index.web.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +==== /node_modules/conditions/package.json (0 errors) ==== + { + "name": "conditions", + "version": "1.0.0", + "type": "module", + "main": "index.cjs", + "types": "index.d.cts", + "exports": { + ".": { + "node": "./index.node.js", + "default": "./index.web.js" + } + } + } + +==== /node_modules/conditions/index.node.js (0 errors) ==== + export const node = 0; + +==== /node_modules/conditions/index.node.d.ts (0 errors) ==== + export const node: number; + +==== /node_modules/conditions/index.web.js (0 errors) ==== + export const web = 0; + +==== /node_modules/conditions/index.web.d.ts (0 errors) ==== + export const web: number; + +==== /main.ts (0 errors) ==== + import { web } from "conditions"; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=preserve).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=preserve).errors.txt.diff deleted file mode 100644 index 4eb014059c..0000000000 --- a/testdata/baselines/reference/submodule/conformance/bundlerConditionsExcludesNode(module=preserve).errors.txt.diff +++ /dev/null @@ -1,48 +0,0 @@ ---- old.bundlerConditionsExcludesNode(module=preserve).errors.txt -+++ new.bundlerConditionsExcludesNode(module=preserve).errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/node_modules/conditions/index.node.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/conditions/index.web.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation -- -- --!!! error TS6504: File '/node_modules/conditions/index.node.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/conditions/index.web.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --==== /node_modules/conditions/package.json (0 errors) ==== -- { -- "name": "conditions", -- "version": "1.0.0", -- "type": "module", -- "main": "index.cjs", -- "types": "index.d.cts", -- "exports": { -- ".": { -- "node": "./index.node.js", -- "default": "./index.web.js" -- } -- } -- } -- --==== /node_modules/conditions/index.node.js (0 errors) ==== -- export const node = 0; -- --==== /node_modules/conditions/index.node.d.ts (0 errors) ==== -- export const node: number; -- --==== /node_modules/conditions/index.web.js (0 errors) ==== -- export const web = 0; -- --==== /node_modules/conditions/index.web.d.ts (0 errors) ==== -- export const web: number; -- --==== /main.ts (0 errors) ==== -- import { web } from "conditions"; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).errors.txt b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).errors.txt index 7b37a0edde..b25d226dac 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).errors.txt @@ -1,8 +1,20 @@ +error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation /main.cts(1,10): error TS2305: Module '"dual"' has no exported member 'esm'. /main.mts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'. /main.ts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'. +!!! error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation ==== /node_modules/dual/package.json (0 errors) ==== { "name": "dual", diff --git a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).errors.txt.diff deleted file mode 100644 index 03de766a92..0000000000 --- a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=esnext).errors.txt.diff +++ /dev/null @@ -1,23 +0,0 @@ ---- old.bundlerNodeModules1(module=esnext).errors.txt -+++ new.bundlerNodeModules1(module=esnext).errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation - /main.cts(1,10): error TS2305: Module '"dual"' has no exported member 'esm'. - /main.mts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'. - /main.ts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'. - - --!!! error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation - ==== /node_modules/dual/package.json (0 errors) ==== - { - "name": "dual", \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).errors.txt b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).errors.txt index 7b37a0edde..b25d226dac 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).errors.txt @@ -1,8 +1,20 @@ +error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation /main.cts(1,10): error TS2305: Module '"dual"' has no exported member 'esm'. /main.mts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'. /main.ts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'. +!!! error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation ==== /node_modules/dual/package.json (0 errors) ==== { "name": "dual", diff --git a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).errors.txt.diff deleted file mode 100644 index d957e01b34..0000000000 --- a/testdata/baselines/reference/submodule/conformance/bundlerNodeModules1(module=preserve).errors.txt.diff +++ /dev/null @@ -1,23 +0,0 @@ ---- old.bundlerNodeModules1(module=preserve).errors.txt -+++ new.bundlerNodeModules1(module=preserve).errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation - /main.cts(1,10): error TS2305: Module '"dual"' has no exported member 'esm'. - /main.mts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'. - /main.ts(1,15): error TS2305: Module '"dual"' has no exported member 'cjs'. - - --!!! error TS6504: File '/node_modules/dual/index.cjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/dual/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation - ==== /node_modules/dual/package.json (0 errors) ==== - { - "name": "dual", \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAtTypesPriority.errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesAtTypesPriority.errors.txt new file mode 100644 index 0000000000..0f30543054 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAtTypesPriority.errors.txt @@ -0,0 +1,34 @@ +error TS6504: File '/packages/a/node_modules/react/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/packages/a/node_modules/redux/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation + + +!!! error TS6504: File '/packages/a/node_modules/react/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/packages/a/node_modules/redux/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +==== /node_modules/@types/react/index.d.ts (0 errors) ==== + declare const React: any; + export = React; + +==== /node_modules/@types/redux/index.d.ts (0 errors) ==== + export declare function createStore(): void; + +==== /packages/a/node_modules/react/index.js (0 errors) ==== + module.exports = {}; + +==== /packages/a/node_modules/redux/index.d.ts (0 errors) ==== + export declare function createStore(): void; + +==== /packages/a/node_modules/redux/index.js (0 errors) ==== + module.exports = {}; + +==== /packages/a/index.ts (0 errors) ==== + import React from "react"; + import { createStore } from "redux"; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAtTypesPriority.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesAtTypesPriority.errors.txt.diff deleted file mode 100644 index eade98ce48..0000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAtTypesPriority.errors.txt.diff +++ /dev/null @@ -1,38 +0,0 @@ ---- old.nodeModulesAtTypesPriority.errors.txt -+++ new.nodeModulesAtTypesPriority.errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/packages/a/node_modules/react/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/packages/a/node_modules/redux/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation -- -- --!!! error TS6504: File '/packages/a/node_modules/react/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/packages/a/node_modules/redux/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --==== /node_modules/@types/react/index.d.ts (0 errors) ==== -- declare const React: any; -- export = React; -- --==== /node_modules/@types/redux/index.d.ts (0 errors) ==== -- export declare function createStore(): void; -- --==== /packages/a/node_modules/react/index.js (0 errors) ==== -- module.exports = {}; -- --==== /packages/a/node_modules/redux/index.d.ts (0 errors) ==== -- export declare function createStore(): void; -- --==== /packages/a/node_modules/redux/index.js (0 errors) ==== -- module.exports = {}; -- --==== /packages/a/index.ts (0 errors) ==== -- import React from "react"; -- import { createStore } from "redux"; -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).errors.txt index 8300f6aaaa..a0ed330173 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).errors.txt @@ -1,3 +1,6 @@ +error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation /main.cts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` /main.cts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. @@ -8,6 +11,9 @@ /main.mts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. +!!! error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation ==== /node_modules/exports-and-types-versions/package.json (0 errors) ==== { "name": "exports-and-types-versions", diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).errors.txt.diff deleted file mode 100644 index f21056a46c..0000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node16).errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.nodeModulesExportsBlocksTypesVersions(module=node16).errors.txt -+++ new.nodeModulesExportsBlocksTypesVersions(module=node16).errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation - /main.cts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. - If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` - /main.cts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. -@@= skipped -10, +7 lines =@@ - /main.mts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. - - --!!! error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation - ==== /node_modules/exports-and-types-versions/package.json (0 errors) ==== - { - "name": "exports-and-types-versions", \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt index 8300f6aaaa..a0ed330173 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt @@ -1,3 +1,6 @@ +error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation /main.cts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` /main.cts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. @@ -8,6 +11,9 @@ /main.mts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. +!!! error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation ==== /node_modules/exports-and-types-versions/package.json (0 errors) ==== { "name": "exports-and-types-versions", diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt.diff deleted file mode 100644 index a4906f98e3..0000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt -+++ new.nodeModulesExportsBlocksTypesVersions(module=node18).errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation - /main.cts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. - If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` - /main.cts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. -@@= skipped -10, +7 lines =@@ - /main.mts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. - - --!!! error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation - ==== /node_modules/exports-and-types-versions/package.json (0 errors) ==== - { - "name": "exports-and-types-versions", \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt index 8300f6aaaa..a0ed330173 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt @@ -1,3 +1,6 @@ +error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation /main.cts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` /main.cts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. @@ -8,6 +11,9 @@ /main.mts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. +!!! error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation ==== /node_modules/exports-and-types-versions/package.json (0 errors) ==== { "name": "exports-and-types-versions", diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt.diff deleted file mode 100644 index 70c6cfa3d3..0000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt -+++ new.nodeModulesExportsBlocksTypesVersions(module=node20).errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation - /main.cts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. - If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` - /main.cts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. -@@= skipped -10, +7 lines =@@ - /main.mts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. - - --!!! error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation - ==== /node_modules/exports-and-types-versions/package.json (0 errors) ==== - { - "name": "exports-and-types-versions", \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).errors.txt index 8300f6aaaa..a0ed330173 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).errors.txt @@ -1,3 +1,6 @@ +error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation /main.cts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` /main.cts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. @@ -8,6 +11,9 @@ /main.mts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. +!!! error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation ==== /node_modules/exports-and-types-versions/package.json (0 errors) ==== { "name": "exports-and-types-versions", diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).errors.txt.diff deleted file mode 100644 index 32caba6b9f..0000000000 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesExportsBlocksTypesVersions(module=nodenext).errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.nodeModulesExportsBlocksTypesVersions(module=nodenext).errors.txt -+++ new.nodeModulesExportsBlocksTypesVersions(module=nodenext).errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation - /main.cts(1,16): error TS7016: Could not find a declaration file for module 'exports-and-types-versions/foo'. '/node_modules/exports-and-types-versions/dist/foo.js' implicitly has an 'any' type. - If the 'exports-and-types-versions' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'exports-and-types-versions/foo';` - /main.cts(2,16): error TS2307: Cannot find module 'exports-and-types-versions/nope' or its corresponding type declarations. -@@= skipped -10, +7 lines =@@ - /main.mts(5,16): error TS2307: Cannot find module 'exports-and-types-versions/versioned-nah' or its corresponding type declarations. - - --!!! error TS6504: File '/node_modules/exports-and-types-versions/dist/foo.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation - ==== /node_modules/exports-and-types-versions/package.json (0 errors) ==== - { - "name": "exports-and-types-versions", \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt index c282ce8a1f..fe904ca695 100644 --- a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt @@ -1,9 +1,33 @@ +error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/bar/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation /index.mts(1,21): error TS7016: Could not find a declaration file for module 'foo'. '/node_modules/foo/index.mjs' implicitly has an 'any' type. There are types at '/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. /index.mts(2,21): error TS7016: Could not find a declaration file for module 'bar'. '/node_modules/bar/index.mjs' implicitly has an 'any' type. There are types at '/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. +!!! error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/bar/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation ==== /node_modules/foo/package.json (0 errors) ==== { "name": "foo", diff --git a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt.diff deleted file mode 100644 index a2bc1e8d1e..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt.diff +++ /dev/null @@ -1,36 +0,0 @@ ---- old.resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt -+++ new.resolvesWithoutExportsDiagnostic1(moduleresolution=bundler).errors.txt -@@= skipped -0, +0 lines =@@ --error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/bar/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation - /index.mts(1,21): error TS7016: Could not find a declaration file for module 'foo'. '/node_modules/foo/index.mjs' implicitly has an 'any' type. - There are types at '/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. - /index.mts(2,21): error TS7016: Could not find a declaration file for module 'bar'. '/node_modules/bar/index.mjs' implicitly has an 'any' type. - There are types at '/node_modules/@types/bar/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@types/bar' library may need to update its package.json or typings. - - --!!! error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/bar/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation - ==== /node_modules/foo/package.json (0 errors) ==== - { - "name": "foo", \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt index cc9f7f36f2..7fa0a30235 100644 --- a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt @@ -1,4 +1,16 @@ error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/bar/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation +error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? + The file is in the program because: + Root file specified for compilation /index.mts(1,21): error TS7016: Could not find a declaration file for module 'foo'. '/node_modules/foo/index.mjs' implicitly has an 'any' type. There are types at '/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. /index.mts(2,21): error TS7016: Could not find a declaration file for module 'bar'. '/node_modules/bar/index.mjs' implicitly has an 'any' type. @@ -6,6 +18,18 @@ error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolut !!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. +!!! error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/bar/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation +!!! error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? +!!! error TS6504: The file is in the program because: +!!! error TS6504: Root file specified for compilation ==== /node_modules/foo/package.json (0 errors) ==== { "name": "foo", diff --git a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt.diff deleted file mode 100644 index fc9652b0df..0000000000 --- a/testdata/baselines/reference/submodule/conformance/resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt.diff +++ /dev/null @@ -1,38 +0,0 @@ ---- old.resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt -+++ new.resolvesWithoutExportsDiagnostic1(moduleresolution=node16).errors.txt -@@= skipped -0, +0 lines =@@ - error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. --error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/bar/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation --error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? -- The file is in the program because: -- Root file specified for compilation - /index.mts(1,21): error TS7016: Could not find a declaration file for module 'foo'. '/node_modules/foo/index.mjs' implicitly has an 'any' type. - There are types at '/node_modules/foo/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'foo' library may need to update its package.json or typings. - /index.mts(2,21): error TS7016: Could not find a declaration file for module 'bar'. '/node_modules/bar/index.mjs' implicitly has an 'any' type. -@@= skipped -17, +5 lines =@@ - - - !!! error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. --!!! error TS6504: File '/node_modules/bar/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/bar/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/foo/index.js' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation --!!! error TS6504: File '/node_modules/foo/index.mjs' is a JavaScript file. Did you mean to enable the 'allowJs' option? --!!! error TS6504: The file is in the program because: --!!! error TS6504: Root file specified for compilation - ==== /node_modules/foo/package.json (0 errors) ==== - { - "name": "foo", \ No newline at end of file