Skip to content

Commit 4a8afcd

Browse files
authored
Merge pull request #247 from velut/patch-1
Fix typo
2 parents 4a3efba + 2e680e4 commit 4a8afcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/problems/FallbackCondition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ This issue commonly occurs in combination with [“Masquerading as CJS”](./Fal
5757
where an `index.d.ts` exists but `index.d.mts` does not. TypeScript first does a resolution pass only looking for types and ignoring JavaScript files, so when resolving with the `import` condition, that first pass goes something like:
5858

5959
1. `"import"` matches, so try substituting the `.mjs` extension for the type-equivalent `.d.mts`. `index.d.mts` does not exist, so **continue** (this is the bug).
60-
2. `"default"` conditions always match, so try substituting the `.js` extension for the type-equivalent `.d.ts`. `index.d.ts` exists, so us that as a resolution result.
60+
2. `"default"` conditions always match, so try substituting the `.js` extension for the type-equivalent `.d.ts`. `index.d.ts` exists, so use that as a resolution result.
6161

6262
But in this example, `index.d.ts` is a CommonJS module since the package.json lacks a `"type": "module"` field, whereas the runtime resolution would have been `index.mjs`, which is an ES module. So, an instance of [“Masquerading as CJS”](./FalseCJS.md) also occurred. If the library adds an `index.d.mts` file to represent the `index.mjs` file, both problems will be solved simultaneously.

0 commit comments

Comments
 (0)