feat(linter): add override for noImportsOfLazyLoadedLibraries (#15670)
This commit is contained in:
parent
a868bce63b
commit
9ef2dd90dd
@ -49,6 +49,7 @@ type Options = [
|
|||||||
depConstraints: DepConstraint[];
|
depConstraints: DepConstraint[];
|
||||||
enforceBuildableLibDependency: boolean;
|
enforceBuildableLibDependency: boolean;
|
||||||
allowCircularSelfDependency: boolean;
|
allowCircularSelfDependency: boolean;
|
||||||
|
checkDynamicDependenciesExceptions: string[];
|
||||||
banTransitiveDependencies: boolean;
|
banTransitiveDependencies: boolean;
|
||||||
checkNestedExternalImports: boolean;
|
checkNestedExternalImports: boolean;
|
||||||
}
|
}
|
||||||
@ -85,6 +86,7 @@ export default createESLintRule<Options, MessageIds>({
|
|||||||
properties: {
|
properties: {
|
||||||
enforceBuildableLibDependency: { type: 'boolean' },
|
enforceBuildableLibDependency: { type: 'boolean' },
|
||||||
allowCircularSelfDependency: { type: 'boolean' },
|
allowCircularSelfDependency: { type: 'boolean' },
|
||||||
|
checkDynamicDependenciesExceptions: [{ type: 'string' }],
|
||||||
banTransitiveDependencies: { type: 'boolean' },
|
banTransitiveDependencies: { type: 'boolean' },
|
||||||
checkNestedExternalImports: { type: 'boolean' },
|
checkNestedExternalImports: { type: 'boolean' },
|
||||||
allow: [{ type: 'string' }],
|
allow: [{ type: 'string' }],
|
||||||
@ -139,6 +141,7 @@ export default createESLintRule<Options, MessageIds>({
|
|||||||
depConstraints: [],
|
depConstraints: [],
|
||||||
enforceBuildableLibDependency: false,
|
enforceBuildableLibDependency: false,
|
||||||
allowCircularSelfDependency: false,
|
allowCircularSelfDependency: false,
|
||||||
|
checkDynamicDependenciesExceptions: [],
|
||||||
banTransitiveDependencies: false,
|
banTransitiveDependencies: false,
|
||||||
checkNestedExternalImports: false,
|
checkNestedExternalImports: false,
|
||||||
},
|
},
|
||||||
@ -151,6 +154,7 @@ export default createESLintRule<Options, MessageIds>({
|
|||||||
depConstraints,
|
depConstraints,
|
||||||
enforceBuildableLibDependency,
|
enforceBuildableLibDependency,
|
||||||
allowCircularSelfDependency,
|
allowCircularSelfDependency,
|
||||||
|
checkDynamicDependenciesExceptions,
|
||||||
banTransitiveDependencies,
|
banTransitiveDependencies,
|
||||||
checkNestedExternalImports,
|
checkNestedExternalImports,
|
||||||
},
|
},
|
||||||
@ -494,6 +498,9 @@ export default createESLintRule<Options, MessageIds>({
|
|||||||
if (
|
if (
|
||||||
node.type === AST_NODE_TYPES.ImportDeclaration &&
|
node.type === AST_NODE_TYPES.ImportDeclaration &&
|
||||||
node.importKind !== 'type' &&
|
node.importKind !== 'type' &&
|
||||||
|
!checkDynamicDependenciesExceptions.some((a) =>
|
||||||
|
matchImportWithWildcard(a, imp)
|
||||||
|
) &&
|
||||||
onlyLoadChildren(
|
onlyLoadChildren(
|
||||||
projectGraph,
|
projectGraph,
|
||||||
sourceProject.name,
|
sourceProject.name,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user