Skip to content

Commit 4ae8ff8

Browse files
harijoeclaude
andcommitted
fix: enforce .js import extensions via biome project domain
The `useImportExtensions` rule was configured but never ran because the biome `project` domain wasn't enabled. Enable it for `packages/core/**` and fix the 3 existing violations (2 extensionless `import type`, 1 bare directory import) that could cause ESM runtime crashes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4012531 commit 4ae8ff8

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

biome.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@
5757
{
5858
"includes": ["packages/core/**"],
5959
"linter": {
60+
"domains": {
61+
"project": "all"
62+
},
6063
"rules": {
6164
"correctness": {
65+
"noUnresolvedImports": "off",
6266
"useImportExtensions": {
6367
"level": "error",
6468
"options": {

packages/core/src/server/express.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import http from "node:http";
22
import type { ErrorRequestHandler, RequestHandler } from "express";
33
import { afterEach, describe, expect, it, vi } from "vitest";
4-
import type { McpServer } from "./server";
4+
import type { McpServer } from "./server.js";
55

66
vi.mock("@skybridge/devtools", () => ({
77
devtoolsStaticServer: () =>

packages/core/src/server/express.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from "node:path";
33
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
44
import cors from "cors";
55
import express from "express";
6-
import type { McpServer } from "./server";
6+
import type { McpServer } from "./server.js";
77

88
function applyMiddlewares(
99
app: express.Express,

packages/core/src/version.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { createRequire } from "node:module";
22

33
const require = createRequire(import.meta.url);
4+
// biome-ignore lint/correctness/useImportExtensions: CJS require() for JSON, not an ESM import
45
const pkg = require("../package.json") as { version: string };
56

67
export const VERSION: string = pkg.version;

packages/core/src/web/components/modal-provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ReactNode, useEffect, useSyncExternalStore } from "react";
2-
import { McpAppAdaptor } from "../bridges";
2+
import { McpAppAdaptor } from "../bridges/index.js";
33

44
const modalStyles = `
55
.sb-modal-backdrop {

0 commit comments

Comments
 (0)