EagleEyeVisitor class
A visitor that analyzes import directives to validate architectural rules defined in an EagleEyeConfigItem.
The EagleEyeVisitor traverses the Dart AST and checks each import directive to ensure it follows the dependency rules specified in configItem. It only validates internal imports belonging to the same application (filtered using applicationName).
Depending on the configuration, it can:
- Forbid any imports (
noDependsEnabled) - Disallow specific imports (
doNotWithPatterns) - Restrict imports to specific modules only (
justWithPatterns)
Violations are reported via the errorCallback.
- Inheritance
-
- Object
- RecursiveAstVisitor<
void> - EagleEyeVisitor
Constructors
- EagleEyeVisitor({required EagleEyeConfigItem configItem, required String filePath, required dynamic errorCallback(AnalysisErrorInfo), required RegexHelper regexHelper, required String applicationName})
- Creates a new EagleEyeVisitor with the given configuration, file path, callback, and helpers.
Properties
- applicationName → String
-
The name of the current application, used to identify internal imports.
final
- configItem → EagleEyeConfigItem
-
The configuration item that defines the dependency rules to enforce.
final
- errorCallback → dynamic Function(AnalysisErrorInfo)
-
Callback used to report detected rule violations.
final
- filePath → String
-
The path of the file currently being analyzed.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- regexHelper → RegexHelper
-
Helper used for regex-based pattern matching.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
visitAdjacentStrings(
AdjacentStrings node) → void -
inherited
-
visitAnnotation(
Annotation node) → void -
inherited
-
visitArgumentList(
ArgumentList node) → void -
inherited
-
visitAsExpression(
AsExpression node) → void -
inherited
-
visitAssertInitializer(
AssertInitializer node) → void -
inherited
-
visitAssertStatement(
AssertStatement node) → void -
inherited
-
visitAssignedVariablePattern(
AssignedVariablePattern node) → void -
inherited
-
visitAssignmentExpression(
AssignmentExpression node) → void -
inherited
-
visitAwaitExpression(
AwaitExpression node) → void -
inherited
-
visitBinaryExpression(
BinaryExpression node) → void -
inherited
-
visitBlock(
Block node) → void -
inherited
-
visitBlockClassBody(
BlockClassBody node) → void -
inherited
-
visitBlockFunctionBody(
BlockFunctionBody node) → void -
inherited
-
visitBooleanLiteral(
BooleanLiteral node) → void -
inherited
-
visitBreakStatement(
BreakStatement node) → void -
inherited
-
visitCascadeExpression(
CascadeExpression node) → void -
inherited
-
visitCaseClause(
CaseClause node) → void -
inherited
-
visitCastPattern(
CastPattern node) → void -
inherited
-
visitCatchClause(
CatchClause node) → void -
inherited
-
visitCatchClauseParameter(
CatchClauseParameter node) → void -
inherited
-
visitClassDeclaration(
ClassDeclaration node) → void -
inherited
-
visitClassTypeAlias(
ClassTypeAlias node) → void -
inherited
-
visitComment(
Comment node) → void -
inherited
-
visitCommentReference(
CommentReference node) → void -
inherited
-
visitCompilationUnit(
CompilationUnit node) → void -
inherited
-
visitConditionalExpression(
ConditionalExpression node) → void -
inherited
-
visitConfiguration(
Configuration node) → void -
inherited
-
visitConstantPattern(
ConstantPattern node) → void -
inherited
-
visitConstructorDeclaration(
ConstructorDeclaration node) → void -
inherited
-
visitConstructorFieldInitializer(
ConstructorFieldInitializer node) → void -
inherited
-
visitConstructorName(
ConstructorName node) → void -
inherited
-
visitConstructorReference(
ConstructorReference node) → void -
inherited
-
visitConstructorSelector(
ConstructorSelector node) → void -
inherited
-
visitContinueStatement(
ContinueStatement node) → void -
inherited
-
visitDeclaredIdentifier(
DeclaredIdentifier node) → void -
inherited
-
visitDeclaredVariablePattern(
DeclaredVariablePattern node) → void -
inherited
-
visitDefaultFormalParameter(
DefaultFormalParameter node) → void -
inherited
-
visitDoStatement(
DoStatement node) → void -
inherited
-
visitDotShorthandConstructorInvocation(
DotShorthandConstructorInvocation node) → void -
inherited
-
visitDotShorthandInvocation(
DotShorthandInvocation node) → void -
inherited
-
visitDotShorthandPropertyAccess(
DotShorthandPropertyAccess node) → void -
inherited
-
visitDottedName(
DottedName node) → void -
inherited
-
visitDoubleLiteral(
DoubleLiteral node) → void -
inherited
-
visitEmptyClassBody(
EmptyClassBody node) → void -
inherited
-
visitEmptyFunctionBody(
EmptyFunctionBody node) → void -
inherited
-
visitEmptyStatement(
EmptyStatement node) → void -
inherited
-
visitEnumBody(
EnumBody node) → void -
inherited
-
visitEnumConstantArguments(
EnumConstantArguments node) → void -
inherited
-
visitEnumConstantDeclaration(
EnumConstantDeclaration node) → void -
inherited
-
visitEnumDeclaration(
EnumDeclaration node) → void -
inherited
-
visitExportDirective(
ExportDirective node) → void -
inherited
-
visitExpressionFunctionBody(
ExpressionFunctionBody node) → void -
inherited
-
visitExpressionStatement(
ExpressionStatement node) → void -
inherited
-
visitExtendsClause(
ExtendsClause node) → void -
inherited
-
visitExtensionDeclaration(
ExtensionDeclaration node) → void -
inherited
-
visitExtensionOnClause(
ExtensionOnClause node) → void -
inherited
-
visitExtensionOverride(
ExtensionOverride node) → void -
inherited
-
visitExtensionTypeDeclaration(
ExtensionTypeDeclaration node) → void -
inherited
-
visitFieldDeclaration(
FieldDeclaration node) → void -
inherited
-
visitFieldFormalParameter(
FieldFormalParameter node) → void -
inherited
-
visitForEachPartsWithDeclaration(
ForEachPartsWithDeclaration node) → void -
inherited
-
visitForEachPartsWithIdentifier(
ForEachPartsWithIdentifier node) → void -
inherited
-
visitForEachPartsWithPattern(
ForEachPartsWithPattern node) → void -
inherited
-
visitForElement(
ForElement node) → void -
inherited
-
visitFormalParameterList(
FormalParameterList node) → void -
inherited
-
visitForPartsWithDeclarations(
ForPartsWithDeclarations node) → void -
inherited
-
visitForPartsWithExpression(
ForPartsWithExpression node) → void -
inherited
-
visitForPartsWithPattern(
ForPartsWithPattern node) → void -
inherited
-
visitForStatement(
ForStatement node) → void -
inherited
-
visitFunctionDeclaration(
FunctionDeclaration node) → void -
inherited
-
visitFunctionDeclarationStatement(
FunctionDeclarationStatement node) → void -
inherited
-
visitFunctionExpression(
FunctionExpression node) → void -
inherited
-
visitFunctionExpressionInvocation(
FunctionExpressionInvocation node) → void -
inherited
-
visitFunctionReference(
FunctionReference node) → void -
inherited
-
visitFunctionTypeAlias(
FunctionTypeAlias node) → void -
inherited
-
visitFunctionTypedFormalParameter(
FunctionTypedFormalParameter node) → void -
inherited
-
visitGenericFunctionType(
GenericFunctionType node) → void -
inherited
-
visitGenericTypeAlias(
GenericTypeAlias node) → void -
inherited
-
visitGuardedPattern(
GuardedPattern node) → void -
inherited
-
visitHideCombinator(
HideCombinator node) → void -
inherited
-
visitIfElement(
IfElement node) → void -
inherited
-
visitIfStatement(
IfStatement node) → void -
inherited
-
visitImplementsClause(
ImplementsClause node) → void -
inherited
-
visitImplicitCallReference(
ImplicitCallReference node) → void -
inherited
-
visitImportDirective(
ImportDirective node) → void -
Visits each
ImportDirectivenode in the AST and checks if the import complies with the dependency rules defined in configItem.override -
visitImportPrefixReference(
ImportPrefixReference node) → void -
inherited
-
visitIndexExpression(
IndexExpression node) → void -
inherited
-
visitInstanceCreationExpression(
InstanceCreationExpression node) → void -
inherited
-
visitIntegerLiteral(
IntegerLiteral node) → void -
inherited
-
visitInterpolationExpression(
InterpolationExpression node) → void -
inherited
-
visitInterpolationString(
InterpolationString node) → void -
inherited
-
visitIsExpression(
IsExpression node) → void -
inherited
-
visitLabel(
Label node) → void -
inherited
-
visitLabeledStatement(
LabeledStatement node) → void -
inherited
-
visitLibraryDirective(
LibraryDirective node) → void -
inherited
-
visitLibraryIdentifier(
LibraryIdentifier node) → void -
inherited
-
visitListLiteral(
ListLiteral node) → void -
inherited
-
visitListPattern(
ListPattern node) → void -
inherited
-
visitLogicalAndPattern(
LogicalAndPattern node) → void -
inherited
-
visitLogicalOrPattern(
LogicalOrPattern node) → void -
inherited
-
visitMapLiteralEntry(
MapLiteralEntry node) → void -
inherited
-
visitMapPattern(
MapPattern node) → void -
inherited
-
visitMapPatternEntry(
MapPatternEntry node) → void -
inherited
-
visitMethodDeclaration(
MethodDeclaration node) → void -
inherited
-
visitMethodInvocation(
MethodInvocation node) → void -
inherited
-
visitMixinDeclaration(
MixinDeclaration node) → void -
inherited
-
visitMixinOnClause(
MixinOnClause node) → void -
inherited
-
visitNamedExpression(
NamedExpression node) → void -
inherited
-
visitNamedType(
NamedType node) → void -
inherited
-
visitNameWithTypeParameters(
NameWithTypeParameters node) → void -
inherited
-
visitNativeClause(
NativeClause node) → void -
inherited
-
visitNativeFunctionBody(
NativeFunctionBody node) → void -
inherited
-
visitNullAssertPattern(
NullAssertPattern node) → void -
inherited
-
visitNullAwareElement(
NullAwareElement node) → void -
inherited
-
visitNullCheckPattern(
NullCheckPattern node) → void -
inherited
-
visitNullLiteral(
NullLiteral node) → void -
inherited
-
visitObjectPattern(
ObjectPattern node) → void -
inherited
-
visitParenthesizedExpression(
ParenthesizedExpression node) → void -
inherited
-
visitParenthesizedPattern(
ParenthesizedPattern node) → void -
inherited
-
visitPartDirective(
PartDirective node) → void -
inherited
-
visitPartOfDirective(
PartOfDirective node) → void -
inherited
-
visitPatternAssignment(
PatternAssignment node) → void -
inherited
-
visitPatternField(
PatternField node) → void -
inherited
-
visitPatternFieldName(
PatternFieldName node) → void -
inherited
-
visitPatternVariableDeclaration(
PatternVariableDeclaration node) → void -
inherited
-
visitPatternVariableDeclarationStatement(
PatternVariableDeclarationStatement node) → void -
inherited
-
visitPostfixExpression(
PostfixExpression node) → void -
inherited
-
visitPrefixedIdentifier(
PrefixedIdentifier node) → void -
inherited
-
visitPrefixExpression(
PrefixExpression node) → void -
inherited
-
visitPrimaryConstructorDeclaration(
PrimaryConstructorDeclaration node) → void -
inherited
-
visitPrimaryConstructorName(
PrimaryConstructorName node) → void -
inherited
-
visitPropertyAccess(
PropertyAccess node) → void -
inherited
-
visitRecordLiteral(
RecordLiteral node) → void -
inherited
-
visitRecordPattern(
RecordPattern node) → void -
inherited
-
visitRecordTypeAnnotation(
RecordTypeAnnotation node) → void -
inherited
-
visitRecordTypeAnnotationNamedField(
RecordTypeAnnotationNamedField node) → void -
inherited
-
visitRecordTypeAnnotationNamedFields(
RecordTypeAnnotationNamedFields node) → void -
inherited
-
visitRecordTypeAnnotationPositionalField(
RecordTypeAnnotationPositionalField node) → void -
inherited
-
visitRedirectingConstructorInvocation(
RedirectingConstructorInvocation node) → void -
inherited
-
visitRelationalPattern(
RelationalPattern node) → void -
inherited
-
visitRepresentationConstructorName(
RepresentationConstructorName node) → void -
inherited
-
visitRepresentationDeclaration(
RepresentationDeclaration node) → void -
inherited
-
visitRestPatternElement(
RestPatternElement node) → void -
inherited
-
visitRethrowExpression(
RethrowExpression node) → void -
inherited
-
visitReturnStatement(
ReturnStatement node) → void -
inherited
-
visitScriptTag(
ScriptTag node) → void -
inherited
-
visitSetOrMapLiteral(
SetOrMapLiteral node) → void -
inherited
-
visitShowCombinator(
ShowCombinator node) → void -
inherited
-
visitSimpleFormalParameter(
SimpleFormalParameter node) → void -
inherited
-
visitSimpleIdentifier(
SimpleIdentifier node) → void -
inherited
-
visitSimpleStringLiteral(
SimpleStringLiteral node) → void -
inherited
-
visitSpreadElement(
SpreadElement node) → void -
inherited
-
visitStringInterpolation(
StringInterpolation node) → void -
inherited
-
visitSuperConstructorInvocation(
SuperConstructorInvocation node) → void -
inherited
-
visitSuperExpression(
SuperExpression node) → void -
inherited
-
visitSuperFormalParameter(
SuperFormalParameter node) → void -
inherited
-
visitSwitchCase(
SwitchCase node) → void -
inherited
-
visitSwitchDefault(
SwitchDefault node) → void -
inherited
-
visitSwitchExpression(
SwitchExpression node) → void -
inherited
-
visitSwitchExpressionCase(
SwitchExpressionCase node) → void -
inherited
-
visitSwitchPatternCase(
SwitchPatternCase node) → void -
inherited
-
visitSwitchStatement(
SwitchStatement node) → void -
inherited
-
visitSymbolLiteral(
SymbolLiteral node) → void -
inherited
-
visitThisExpression(
ThisExpression node) → void -
inherited
-
visitThrowExpression(
ThrowExpression node) → void -
inherited
-
visitTopLevelVariableDeclaration(
TopLevelVariableDeclaration node) → void -
inherited
-
visitTryStatement(
TryStatement node) → void -
inherited
-
visitTypeArgumentList(
TypeArgumentList node) → void -
inherited
-
visitTypeLiteral(
TypeLiteral node) → void -
inherited
-
visitTypeParameter(
TypeParameter node) → void -
inherited
-
visitTypeParameterList(
TypeParameterList node) → void -
inherited
-
visitVariableDeclaration(
VariableDeclaration node) → void -
inherited
-
visitVariableDeclarationList(
VariableDeclarationList node) → void -
inherited
-
visitVariableDeclarationStatement(
VariableDeclarationStatement node) → void -
inherited
-
visitWhenClause(
WhenClause node) → void -
inherited
-
visitWhileStatement(
WhileStatement node) → void -
inherited
-
visitWildcardPattern(
WildcardPattern node) → void -
inherited
-
visitWithClause(
WithClause node) → void -
inherited
-
visitYieldStatement(
YieldStatement node) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited