LintRule class abstract

Describes a lint rule.

Implemented types

Constructors

LintRule.new({required String name, required Group group, required String description, required String details, Maturity maturity = Maturity.stable, String? documentation, bool hasDocumentation = false})

Properties

description String
Short description suitable for display in console output.
final
details String
Description (in markdown format) suitable for display in a detailed lint description.
final
documentation String?
The documentation for the lint that should appear on the Diagnostic messages page. This field should never be accessed in any code in lib or bin.
final
group Group
Lint group (for example, 'style').
final
hasDocumentation bool
A flag indicating whether this lint has documentation on the Diagnostic messages page.
final
hashCode int
The hash code for this object.
no setterinherited
incompatibleRules List<String>
A list of incompatible rule ids.
no setter
lintCode LintCode
Return the lint code associated with this linter.
no setter
lintCodes List<LintCode>
Return the lint codes associated with this lint rule.
no setterinherited
maturity Maturity
Lint maturity (stable|experimental).
final
name String
Lint name.
final
reporter ↔ ErrorReporter
Used to report lint warnings. NOTE: this is set by the framework before visit begins.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(LintRule other) int
Compares this object to another object.
override
getPubspecVisitor() PubspecVisitor?
Return a visitor to be passed to pubspecs to perform lint analysis. Lint errors are reported via this Linter's error reporter.
getVisitor() → AstVisitor?
Return a visitor to be passed to compilation units to perform lint analysis. Lint errors are reported via this Linter's error reporter.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerNodeProcessors(NodeLintRegistry registry, LinterContext context) → void
This method is invoked to let the LintRule register node processors in the given registry.
inherited
reportLint(AstNode? node, {List<Object> arguments = const [], List<DiagnosticMessage>? contextMessages, ErrorCode? errorCode, bool ignoreSyntheticNodes = true}) → void
reportLintForOffset(int offset, int length, {List<Object> arguments = const [], List<DiagnosticMessage>? contextMessages, ErrorCode? errorCode}) → void
reportLintForToken(Token? token, {List<Object> arguments = const [], List<DiagnosticMessage>? contextMessages, ErrorCode? errorCode, bool ignoreSyntheticTokens = true}) → void
reportPubLint(PSNode node) → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited