Skip to content

Commit

Permalink
feat: allow TypeScript v5 moduleResolution: "bundler" (#5576)
Browse files Browse the repository at this point in the history
  • Loading branch information
buzinas authored Mar 4, 2023
1 parent 342dc60 commit f218b33
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cool-planets-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": minor
---

Allow moduleResolution:"bundler" on tsconfig.json
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
- bsharrow
- bsides
- bustamantedev
- buzinas
- c43721
- camiaei
- CanRau
Expand Down
20 changes: 20 additions & 0 deletions integration/tsconfig-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,26 @@ test("shouldn't change suggested config if set", async () => {
expect(tsconfig).toEqual(config);
});

test("shouldn't change suggested config for moduleResolution: bundler", async () => {
let config = {
...DEFAULT_CONFIG,
compilerOptions: {
...DEFAULT_CONFIG.compilerOptions,
strict: false,
moduleResolution: "bundler",
},
};

let fixture = await createFixture({
files: {
"tsconfig.json": json(config),
},
});

let tsconfig = await getTsConfig(fixture.projectDir);
expect(tsconfig).toEqual(config);
});

test("allows for `extends` in tsconfig", async () => {
let config = {
extends: "./tsconfig.base.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function writeConfigDefaults(configPath: string) {
}

if (
!["node", "node16", "nodenext"].includes(
!["node", "node16", "nodenext", "bundler"].includes(
fullConfig.compilerOptions.moduleResolution.toLowerCase()
)
) {
Expand Down

0 comments on commit f218b33

Please sign in to comment.