diff --git a/package.json b/package.json index b6365c7..9f632d5 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dev": "unbuild --stub", "postinstall": "is-ci || husky install", "lint": "eslint --ext .js,.jsx,.ts,.tsx \"{src,tests}/**\"", - "precommit": "lint-staged -c ./.husky/.lintstagedrc -q", + "precommit": "lint-staged -c ./.husky/.lintstagedrc -q --allow-empty", "prepublishOnly": "pinst --disable", "prettier": "pretty-quick --staged && pnpm run lint", "postpublish": "pinst --enable", diff --git a/src/utils.ts b/src/utils.ts index b044813..cbfcd9d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -439,9 +439,13 @@ export function parseTsAliases(basePath: string, paths: ts.MapLike) { export function tryGetPackageInfo(name: string) { try { - return ( - getPackageInfoSync(name) ?? - getPackageInfoSync(name, { paths: [resolveModule(name) || process.cwd()] }) - ) + return (getPackageInfoSync(name) ?? + getPackageInfoSync(name, { paths: [resolveModule(name) || process.cwd()] })) as { + name: string, + version: string | undefined, + rootPath: string, + packageJsonPath: string, + packageJson: any + } } catch (e) {} }