BaseAnalyzer class abstract
The base interface for all custom lint analyzers.
Implement this to define a custom lint rule. Each analyzer is responsible for
analyzing a Dart AST CompilationUnit and returning a list of LintIssues
that represent violations of the rule.
- Implementers
- AvoidStaticColorsAnalyzer
- AvoidStaticTypographyAnalyzer
- AvoidTestTimeoutsAnalyzer
- DirectInstantiationAnalyzer
- DocumentFakeParametersAnalyzer
- DocumentInterfaceAnalyzer
- ForcedUnwrappingAnalyzer
- NoInternalMethodDocsAnalyzer
- NoOptionalOperatorsInTestsAnalyzer
- PreferFakeOverMockAnalyzer
- PrivateSubjectAnalyzer
- SealedOverDynamicAnalyzer
- SpecificExceptionTypesAnalyzer
- TestFileMutationCoverageAnalyzer
- TodoWithStoryLinksAnalyzer
Constructors
Properties
- correctionMessage → String
-
The suggested correction message for fixing a violation of this rule.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- problemMessage → String
-
The main problem message shown when this rule is violated.
no setter
- ruleName → String
-
The unique name of the lint rule implemented by this analyzer.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- severity → String
-
The severity of the lint rule (e.g., 'ERROR', 'WARNING').
no setter
Methods
-
analyze(
CompilationUnit unit) → List< LintIssue> -
Analyze the given
CompilationUnitand return a list of LintIssues. -
analyzeWithResolver(
CompilationUnit unit, dynamic resolver) → List< LintIssue> -
Analyze the given
CompilationUnitwith resolver context and return a list of LintIssues. -
createIssue(
AstNode node, {String? customMessage}) → LintIssue -
Helper to create a LintIssue from an
AstNodewith consistent formatting. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
isTestFile(
String path) → bool - Utility to check if a file is a test file (by path).