Skip to content

Commit

Permalink
fix(linter): improve wildcard import parsing to allow full regex (#12877
Browse files Browse the repository at this point in the history
)
  • Loading branch information
meeroslav committed Oct 28, 2022
1 parent 6448274 commit 758956d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/workspace/src/utils/runtime-lint-utils.ts
Expand Up @@ -333,7 +333,8 @@ export function isDirectDependency(target: ProjectGraphExternalNode): boolean {
* @returns
*/
function parseImportWildcards(importDefinition: string): RegExp {
const mappedWildcards = importDefinition.split('*').join('.*');
// we replace all instances of `*`, `**..*` and `.*` with `.*`
const mappedWildcards = importDefinition.split(/(?:\.\*)|\*+/).join('.*');
return new RegExp(`^${new RegExp(mappedWildcards).source}$`);
}

Expand Down

1 comment on commit 758956d

@vercel
Copy link

@vercel vercel bot commented on 758956d Oct 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx-dev-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.