Skip to content

Commit

Permalink
accept _ and . in package names (#790)
Browse files Browse the repository at this point in the history
Co-authored-by: Lars Kappert <[email protected]>
  • Loading branch information
heavybeard and webpro authored Sep 27, 2024
1 parent 2b550b0 commit 84db245
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/knip/src/util/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const getPackageNameFromFilePath = (value: string) => {
return value;
};

export const isStartsLikePackageName = (specifier: string) => /^@?[a-z0-9]/.test(specifier);
export const isStartsLikePackageName = (specifier: string) => /^(@[a-z0-9._]|[a-z0-9])/.test(specifier);

export const isDefinitelyTyped = (packageName: string) => packageName.startsWith(`${DT_SCOPE}/`);

Expand Down

0 comments on commit 84db245

Please sign in to comment.