Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 1 addition & 4 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ import {
ParameterDeclaration,
ParenthesizedExpression,
ParenthesizedTypeNode,
parseConfigFileTextToJson,
PartiallyEmittedExpression,
Path,
pathIsRelative,
Expand Down Expand Up @@ -7715,9 +7714,7 @@ export function base64decode(host: { base64decode?(input: string): string; } | u
export function readJsonOrUndefined(path: string, hostOrText: { readFile(fileName: string): string | undefined; } | string): object | undefined {
const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path);
if (!jsonText) return undefined;
// gracefully handle if readFile fails or returns not JSON
const result = parseConfigFileTextToJson(path, jsonText);
return !result.error ? result.config : undefined;
return tryParseJson(jsonText);
Comment thread
jakebailey marked this conversation as resolved.
Outdated
}

/** @internal */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolut
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts",
"types": "./dist/index.d.ts"
}
}
}
Expand All @@ -26,4 +26,5 @@ error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolut
// Should be an untyped resolution to dep/dist/index.mjs,
// but the first search is only for TS files, and when
// there's no dist/index.d.mts, it continues looking for
// matching conditions and resolves via `types`.
// matching conditions and resolves via `types`.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResol
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts",
"types": "./dist/index.d.ts"
}
}
}
Expand All @@ -26,4 +26,5 @@ error TS5110: Option 'module' must be set to 'NodeNext' when option 'moduleResol
// Should be an untyped resolution to dep/dist/index.mjs,
// but the first search is only for TS files, and when
// there's no dist/index.d.mts, it continues looking for
// matching conditions and resolves via `types`.
// matching conditions and resolves via `types`.

Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import
"./types": {
"types": {
"import": "./index.d.mts",
"require": "./index.d.cts",
"require": "./index.d.cts"
},
"node": {
"import": "./index.mjs",
"require": "./index.cjs"
}
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,16 @@ export const cjsSource = true;
"./types": {
"types": {
"import": "./index.d.mts",
"require": "./index.d.cts",
"require": "./index.d.cts"
},
"node": {
"import": "./index.mjs",
"require": "./index.cjs"
}
}
}
}
}


//// [index.mjs]
// esm format file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import
"./types": {
"types": {
"import": "./index.d.mts",
"require": "./index.d.cts",
"require": "./index.d.cts"
},
"node": {
"import": "./index.mjs",
"require": "./index.cjs"
}
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,16 @@ export const cjsSource = true;
"./types": {
"types": {
"import": "./index.d.mts",
"require": "./index.d.cts",
"require": "./index.d.cts"
},
"node": {
"import": "./index.mjs",
"require": "./index.cjs"
}
}
}
}
}


//// [index.mjs]
// esm format file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import
"./types": {
"types": {
"import": "./index.d.mts",
"require": "./index.d.cts",
"require": "./index.d.cts"
},
"node": {
"import": "./index.mjs",
"require": "./index.cjs"
}
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,16 @@ export const cjsSource = true;
"./types": {
"types": {
"import": "./index.d.mts",
"require": "./index.d.cts",
"require": "./index.d.cts"
},
"node": {
"import": "./index.mjs",
"require": "./index.cjs"
}
}
}
}
}


//// [index.mjs]
// esm format file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import
"./types": {
"types": {
"import": "./index.d.mts",
"require": "./index.d.cts",
"require": "./index.d.cts"
},
"node": {
"import": "./index.mjs",
"require": "./index.cjs"
}
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,16 @@ export const cjsSource = true;
"./types": {
"types": {
"import": "./index.d.mts",
"require": "./index.d.cts",
"require": "./index.d.cts"
},
"node": {
"import": "./index.mjs",
"require": "./index.cjs"
}
}
}
}
}


//// [index.mjs]
// esm format file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJ
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
==== node_modules/inner/package.json (0 errors) ====
{
Expand All @@ -75,4 +75,5 @@ node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJ
"./mjs/*": "./*.mjs",
"./js/*": "./*.js"
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export { type };
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
//// [package.json]
{
Expand All @@ -63,7 +63,8 @@ export { type };
"./mjs/*": "./*.mjs",
"./js/*": "./*.js"
}
}
}


//// [index.js]
// esm format file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJ
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
==== node_modules/inner/package.json (0 errors) ====
{
Expand All @@ -75,4 +75,5 @@ node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJ
"./mjs/*": "./*.mjs",
"./js/*": "./*.js"
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export { type };
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
//// [package.json]
{
Expand All @@ -63,7 +63,8 @@ export { type };
"./mjs/*": "./*.mjs",
"./js/*": "./*.js"
}
}
}


//// [index.js]
// esm format file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
==== node_modules/inner/package.json (0 errors) ====
{
Expand All @@ -66,4 +66,5 @@ node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import
"./mjs/*": "./*.mjs",
"./js/*": "./*.js"
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export { type };
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
//// [package.json]
{
Expand All @@ -63,7 +63,8 @@ export { type };
"./mjs/*": "./*.mjs",
"./js/*": "./*.js"
}
}
}


//// [index.js]
// esm format file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
==== node_modules/inner/package.json (0 errors) ====
{
Expand All @@ -66,4 +66,5 @@ node_modules/inner/index.d.ts(2,13): error TS2303: Circular definition of import
"./mjs/*": "./*.mjs",
"./js/*": "./*.js"
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export { type };
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
//// [package.json]
{
Expand All @@ -63,7 +63,8 @@ export { type };
"./mjs/*": "./*.mjs",
"./js/*": "./*.js"
}
}
}


//// [index.js]
// esm format file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJ
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
==== node_modules/inner/package.json (0 errors) ====
{
Expand All @@ -75,4 +75,5 @@ node_modules/inner/index.d.ts(3,22): error TS1479: The current file is a CommonJ
"./mjs/*.mjs": "./*.mjs",
"./js/*.js": "./*.js"
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export { type };
{
"name": "package",
"private": true,
"type": "module",
"type": "module"
}
//// [package.json]
{
Expand All @@ -63,7 +63,8 @@ export { type };
"./mjs/*.mjs": "./*.mjs",
"./js/*.js": "./*.js"
}
}
}


//// [index.js]
// esm format file
Expand Down
Loading