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