diff --git a/package.json b/package.json index dd092f4..b64bc52 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "build": "unbuild", "dev": "vitest", "lint": "eslint --ext .ts,.js src test && prettier -c src test", + "lint:fix": "eslint --ext .ts,.js src test --fix && prettier -w src test", "release": "pnpm test && pnpm build && changelogen --release && npm publish && git push --follow-tags", "test": "pnpm lint && vitest run" }, diff --git a/src/resolve.ts b/src/resolve.ts index 5b1fa52..ad2f9e0 100644 --- a/src/resolve.ts +++ b/src/resolve.ts @@ -1,7 +1,7 @@ import { existsSync, realpathSync } from "node:fs"; import { pathToFileURL } from "node:url"; import { joinURL } from "ufo"; -import { isAbsolute, join, normalize } from "pathe"; +import { isAbsolute, normalize } from "pathe"; import { moduleResolve } from "import-meta-resolve"; import { PackageJson, readPackageJSON } from "pkg-types"; import { fileURLToPath, normalizeid } from "./utils"; @@ -208,6 +208,7 @@ function _findSubpath(subpath: string, exports: PackageJson["exports"]) { const flattenedExports = _flattenExports(exports); const [foundPath] = + // eslint-disable-next-line @typescript-eslint/no-unused-vars flattenedExports.find(([_, resolved]) => resolved === subpath) || []; return foundPath; diff --git a/src/utils.ts b/src/utils.ts index 9a6dd8f..75b8e0c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,7 +1,6 @@ import { fileURLToPath as _fileURLToPath } from "node:url"; import { promises as fsp } from "node:fs"; import { normalizeSlash, BUILTIN_MODULES } from "./_utils"; -import { StaticImport, TypeImport } from "./analyze"; export function fileURLToPath(id: string): string { if (typeof id === "string" && !id.startsWith("file://")) { diff --git a/test/utils.test.ts b/test/utils.test.ts index c06a05d..0c05b75 100644 --- a/test/utils.test.ts +++ b/test/utils.test.ts @@ -1,4 +1,3 @@ -import { fileURLToPath } from "node:url"; import { describe, it, expect } from "vitest"; import {