Open yorch opened 2 years ago
My current workaround is to import the types manually like:
// @ts-expect-error - Error in the dependency: https://github.com/ycjcl868/git-local-info/issues/1
import GitInfo from 'git-local-info';
import type { IGitInfo } from 'git-local-info/lib/typings';
export const getGitInfo = () => {
const gitInfo = new GitInfo();
return gitInfo.getGitInfo as IGitInfo;
};
Created a fork to address this problem and release it as git-local-info-ts
Seems like
types
/typings
property inpackage.json
is missing, so VSCode cannot properly locate the TS types for the package:More info: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package
Thanks!