Skip to content

Commit

Permalink
chore: explicitly specify unresolved types
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Sep 6, 2024
1 parent 0621332 commit 87a06e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 8 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,13 @@ export function parseTsAliases(basePath: string, paths: ts.MapLike<string[]>) {

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) {}
}

0 comments on commit 87a06e7

Please sign in to comment.