Skip to content

Commit

Permalink
Set "moduleResolution": "bundler" in tsconfig.json
Browse files Browse the repository at this point in the history
This loosens some resolution rules in accordance with how bundlers
like `esbuild` resolve modules. This also allows us to remove a bunch
of `@ts-expect-error`s.
  • Loading branch information
mrbbot committed Jul 21, 2023
1 parent 4bc1a3d commit 76bd32e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions packages/miniflare/src/plugins/queues/gateway.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import assert from "assert";
import crypto from "crypto";
import v8 from "v8";
// @ts-expect-error "devalue" is ESM-only, but we're bundling for CommonJS here.
// That doesn't matter to `esbuild`, which will apply format conversion.
import { stringify } from "devalue";
import { Colorize, bold, green, grey, red, reset, yellow } from "kleur/colors";
import { z } from "zod";
Expand Down
2 changes: 0 additions & 2 deletions packages/miniflare/src/plugins/queues/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-expect-error "devalue" is ESM-only, but we're bundling for CommonJS here.
// That doesn't matter to `esbuild`, which will apply format conversion.
import { stringify } from "devalue";
import semiver from "semiver";
import { z } from "zod";
Expand Down
2 changes: 0 additions & 2 deletions packages/miniflare/src/plugins/queues/router.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-expect-error "devalue" is ESM-only, but we're bundling for CommonJS here.
// That doesn't matter to `esbuild`, which will apply format conversion.
import { parse } from "devalue";
import { z } from "zod";
import { Headers, Response } from "../../http";
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"target": "esnext",
"lib": ["esnext"],
"strict": true,
"moduleResolution": "node16",
"moduleResolution": "bundler",
"esModuleInterop": true,
"isolatedModules": true,
"experimentalDecorators": true,
Expand Down

0 comments on commit 76bd32e

Please sign in to comment.