custom_lint_builder library

Classes

Assist
A base class for assists.
ChangeBuilder
A class for modifying
ChangeReporter
A class used for requesting a ChangeBuilder.
CustomLintConfigs
Configurations representing the custom_lint metadata in the project's analysis_options.yaml.
CustomLintContext
An object for state shared between multiple LintRule/Assist/Fix...
CustomLintResolver
A class used to interact with files and possibly emit lints of out it.
DartAssist
A base class for creating assists inside Dart files.
DartFix
A base class for defining quick-fixes inside Dart files.
DartLintRule
A base class for emitting warnings/errors/infos inside Dart files.
Fix
A base class for plugins to define emit warnings/errors/infos.
LintCode
A class representing an ErrorCode for LintRules.
LintOptions
Option information for a specific LintRule.
LintRule
A base class for plugins to define emit warnings/errors/infos.
LintRuleNodeRegistry
NodeLintRegistry
The container to register visitors for separate AST node types.
PluginBase
A base class for custom analyzer plugins
TypeChecker
An abstraction around doing static type checking at compile/build time.

Extensions

AnalysisErrorSourceRange on AnalysisError
Adds sourceRange
PackageIOUtils on Directory
Utilities to help dealing with paths to common package files.
SyntacticEntitySourceRange on SyntacticEntity
Adds sourceRange

Functions

encodePrioritizedSourceChanges(Iterable<PrioritizedSourceChange> changes, {JsonEncoder? encoder, Map<String, String>? sources, String? relativePath}) String
Encodes a list of PrioritizedSourceChange into a string.
findProjectDirectory(Directory directory, {Directory? original}) Directory
Finds the project directory associated with an analysis context root
matcherNormalizedPrioritizedSourceChangeSnapshot(String filePath, {JsonEncoder? encoder, Map<String, String>? sources, String? relativePath}) → Matcher
Expects that a List<PrioritizedSourceChange> matches with a serialized snapshots.
parsePackageConfig(Directory directory) Future<PackageConfig>
Parse the package config of the given directory.
parsePackageConfigSync(Directory directory) → PackageConfig
Parse the package config of the given directory.
parsePubspec(Directory directory) Future<Pubspec>
Parse the pubspec of the given directory.
parsePubspecOverrides(Directory directory) Future<Map<String, Dependency>>
Parse the pubspec_overrides.yaml of the given directory.
parsePubspecSync(Directory directory) → Pubspec
Parse the pubspec of the given directory.
tryFindProjectDirectory(Directory directory, {Directory? original}) Directory?
Finds the project directory associated with an analysis context root, or null if it is not found
tryParsePackageConfig(Directory directory) Future<PackageConfig?>
Try parsing the package config of the given directory.
tryParsePackageConfigSync(Directory directory) → PackageConfig?
Try parsing the package config of the given directory.
tryParsePubspec(Directory directory) Future<Pubspec?>
Try parsing the pubspec of the given directory.
tryParsePubspecOverrides(Directory directory) Future<Map<String, Dependency>?>
Try parsing the pubspec_overrides.yaml of the given directory.
tryParsePubspecSync(Directory directory) → Pubspec?
Try parsing the pubspec of the given directory.

Exceptions / Errors

UnresolvedAnnotationException
Exception thrown when TypeChecker fails to resolve a metadata annotation.