fix(linter): improve wildcard import parsing to allow full regex (#12877)
This commit is contained in:
parent
6448274cf8
commit
758956d13d
@ -333,7 +333,8 @@ export function isDirectDependency(target: ProjectGraphExternalNode): boolean {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
function parseImportWildcards(importDefinition: string): RegExp {
|
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}$`);
|
return new RegExp(`^${new RegExp(mappedWildcards).source}$`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user