Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 20, 2023
1 parent c4159e5 commit 7237b0b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -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"
},
Expand Down
3 changes: 2 additions & 1 deletion 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";
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion 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://")) {
Expand Down
1 change: 0 additions & 1 deletion test/utils.test.ts
@@ -1,4 +1,3 @@
import { fileURLToPath } from "node:url";
import { describe, it, expect } from "vitest";

import {
Expand Down

0 comments on commit 7237b0b

Please sign in to comment.