NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #453 most downloaded on pub.dev
Lint rules are a powerful way to improve the maintainability of a project. Custom Lint allows package authors and developers to easily write custom lint rules.
Last release 1 years ago
09 Sep 2025
Release timing varies
gaps range from 9 days to 5 months
Nearly every release is documented
notes for 59 of 59 stable releases
1 version withdrawn
withdrawn after publishing
4 years old
61 releases · first in 2022
custom_lint : 0.8.0 -> 0.8.1 custom_lint_builder : 0.8.0 -> 0.8.1
custom_lint : 0.8.0 -> 0.8.1
custom_lint_builder : 0.8.0 -> 0.8.1
custom_lint : 0.7.7 -> 0.8.0 custom_lint_builder : 0.7.7 -> 0.8.0
custom_lint : 0.7.7 -> 0.8.0
custom_lint_builder : 0.7.7 -> 0.8.0
Support analyzer 7.5.0
One column per quarter.
custom_lint : 0.7.6 -> 0.7.7 custom_lint_builder : 0.7.6 -> 0.7.7
custom_lint : 0.7.6 -> 0.7.7
custom_lint_builder : 0.7.6 -> 0.7.7
Fix custom_lint not working on up-to-date Dart
Fix custom_lint not working on up-to-date Dart
Fix inconsistent version
Fix inconsistent version
Support Dart workspaces (thanks to @Rexios80)
- Bump analyzer_plugin
Fix Android Studio/InteliJ (thanks to @EricSchlichting)
- Support analyzer 7.0.0
custom_lint --fix and the generated "Fix all " assists now correctly handle imports.
custom_lint --fix and the generated "Fix all <code>" assists
now correctly handle imports.Support installing custom_lint plugins in dependencies: instead of dev_dependencies (thanks to @dickermoshe).
dependencies: instead of dev_dependencies (thanks to @dickermoshe).custom_lint_core upgraded to 0.6.9
custom_lint_core upgraded to 0.6.9Fix custom_lint not warning non-Dart files when necessary.
.dart_tool/package_config.jsonRemoved offline package resolution for the analyzer plugin. The logic seemed broken at times, so removing it should make custom_lint more stable.
Fixed an error in the CLI when Flutter generates code under .dart_tool/ or has dependencies on iOS libraries (thanks to @Kurogoma4D)
.dart_tool/ or has dependencies on iOS libraries (thanks to @Kurogoma4D)Upgraded to analyzer ^6.6.0. This is a quick fix to unblock the stable Flutter channel. A more robust fix will come later.
Improve error message to attempt debugging a certain bug
Fixed Unimplemented error when running pub get.
pub get.custom_lint --format json no-longer outputs non-JSON logs (thanks to @kzrnm)
custom_lint --format json no-longer outputs non-JSON logs (thanks to @kzrnm)TypeChecker.isSuperTypeOf (thanks to @charlescyt)- Added support for --fix
--fixAdded support for analysis_options.yaml that are nt at the root of the project (thanks to @mrgnhnt96)
analysis_options.yaml that are nt at the root of the project (thanks to @mrgnhnt96)// ignore comments now correctly respect indentation when they are inserted (thanks to @PiotrRogulski)
// ignore comments now correctly respect indentation when they are inserted (thanks to @PiotrRogulski)Support JSON output format via CLI parameter --format json|default (thanks to @kuhnroyal)
--format json|default (thanks to @kuhnroyal)Optimized logic for finding an unused VM_service port.
Optimized logic for finding an unused VM_service port.
- Support hotreloader 4.0.0
hotreloader 4.0.0Sort lints by severity in the command line (thanks to @kuhnroyal)
q (thanks to @kuhnroyal)The command line now supports ignoring warnings/infos with --no-fatal-warnings/--no-fatal-infos (thanks to @yamarkz)
--no-fatal-warnings/--no-fatal-infos (thanks to @yamarkz)Support both analyzer 5.12.0 and 6.0.0 at the same time.
Support analyzer v6
Support analyzer v6
Now resolves packages using pub get if custom_lint failed to resolve packages offline. This should reduce the likelyness of a version conflict in mono
pub get if custom_lint failed to resolve packages offline.
This should reduce the likelyness of a version conflict in mono-repositories.
The conflict may still happen if two projects in a mono-repo use incompatible
constraints. Like:name: foo
dependencies:
package: ^1.0.0
name: bar
dependencies:
package: ^2.0.0
Report uncaught exceptions inside context.addPostRunCallback
context.addPostRunCallbackcustom_lint now automatically generate quick-fixes for "ignore for line/file".
Reduce the likelyness of a dependency version conflict.
dart analyze crashing on large projects in the CI due to custom_lint
incorrectly trying to run plugins in debug mode.custom_lint command line never terminating in some cases where plugins
fail to start (thanks to @kuhnroyal).analyzer to >=5.7.0 <5.11.0LintRuleNodeRegistry and other AstVisitor-like now are based off GeneralizingAstVisitor instead of GeneralizingAstVisitorcli_util to ^0.4.0Revert "Fixed an issue that caused a "Port already in use" error when trying to start custom_lint". This had the opposite effect of what's expected.
Update analyzer to >=5.7.0 <5.8.0
Move json_serializable to dev dependencies
Move json_serializable to dev dependencies
Improved the error message when there is a version conflict in mono-repos (thanks to @@adsonpleal)
sdk: ">=2.19.0 <3.0.0"Fix custom_lint not correctly killing sub-processes when the IDE stops custom_lint.
Fix custom_lint not correctly killing sub-processes when the IDE stops custom_lint.
Fixes an exception thrown when a project contains images.
Fixes an exception thrown when a project contains images.
Large Breaking change This new version introduces large changes to how lints/fixes/assists are defined. Long story short, besides the createPlugin met…
Large Breaking change
This new version introduces large changes to how lints/fixes/assists are defined.
Long story short, besides the createPlugin method, the entire syntax changed.
See the readme, examples, and docs around how to use the new syntax.
The new syntax has multiple benefits:
It is now possible to enable/disable lints inside the analysis_options.yaml
as followed:
# optional
include: path/to/another/analysis_options.yaml
custom_lint:
rules:
# enable a lint rule
- my_lint_rule
# A lint rule that is explicitly disabled
- another_lint_rule: false
Enabling/disabling lints is supported by default with the new syntax. Nothing to do~
Performance improvement when using a large number of lints. The workload of analyzing files is now shared between lints.
The new syntax makes the code simpler to maintain.
Before, the PluginBase.getLints rapidly ended-up doing too much.
Now, it is simple to split the implementation in multiple bits
Do some internal refactoring as an attempt to fix #60
Do some internal refactoring as an attempt to fix #60
Fix an issue where plugins were hot-reloaded when the file analyzed changed.
PluginBase.getLints() is theorically not reinvoked
unless the file analyzed changed.Breaking: The plugin entrypoint has moved. Plugins no-longer should define a /bin/custom_lint.dart file. Instead they should define a /lib/ .dart
Breaking: The plugin entrypoint has moved.
Plugins no-longer should define a /bin/custom_lint.dart file.
Instead they should define a /lib/<my_package_name>.dart
Breaking: The plugin entrypoint is modified. Plugins no-longer
define a "main", but instead define a createPlugin function:
Before:
// /bin/custom_lint.dart
void main(List<String> args, SendPort sendPort) {
startPlugin(sendPort, MyPlugin());
}
After:
// /lib/<my_package_name.dart
MyPlugin createPlugin() => MyPlugin();
Add assist support.
Inside your plugins, you can now override handleGetAssists:
import 'package:analyzer_plugin/protocol/protocol_generated.dart'
as analyzer_plugin;
class MyPlugin extends PluginBase {
// ...
Future<analyzer_plugin.EditGetAssistsResult> handleGetAssists(
ResolvedUnitResult resolvedUnitResult, {
required int offset,
required int length,
}) async {
// TODO return some assists for the given offset
}
}
Fix expect_lint not working if the file doesn't contain any lint.
Fix expect_lint not working if the file doesn't contain any lint.
Custom_lint now has a built-in mechanism for testing lints. Simply write a file that should contain lints for your plugin. Then, using a syntax simila
Custom_lint now has a built-in mechanism for testing lints.
Simply write a file that should contain lints for your plugin.
Then, using a syntax similar to // ignore, write a // expect_lint: code
in the line before your lint:
// expect_lint: riverpod_final_provider
var provider = Provider(...);
When doing this, there are two possible cases:
expect_lint correctly contains the expected lint.// ignore)expect_lint comment will have an error.This allows testing your plugins by simply running custom_lint on your test/example folder.
Then, if any expected lint is missing, the command will fail. But if your plugin correctly
emits the lint, the command will succeed.
Upgrade analyzer/analzer_plugin
Fix custom_lint not working in the IDE
Add debugger and hot-reload support (Thanks to @TimWhiting)
exclude obtains from the analysis_options.yamldart analyze incorrectly failing due to showing the "plugin is starting" lint.Fix custom_lint plugins not working in release mode and when using git dependencies (thanks to @TimWhiting)
Fix custom_lint not showing in the IDE
Fix custom_lint not showing in the IDE
Fix deprecation errors with analyzer
Update docs
Update docs
Lint fixes can now be used when placing the cursor on the last character of a lint
Update description and readme
Update description and readme
Allow lints to emit fixes
Allow lints to emit fixes
Fix a bug where the custom_lint command line may not list all lints
Fix a bug where the custom_lint command line may not list all lints
feat!: getLints now is expected to return a Stream instead of Iterable
feat!: getLints now is expected to return a Stream<Lint> instead of Iterable<Lint>
fix: a bug where the lints shown by the IDE could get out of sync with the actual content of the file
Fixed error reporting if a custom_lint plugin throws but the exception comes from a package instead of the plugin itself.
Fixed error reporting if a custom_lint plugin throws but the exception comes from a package instead of the plugin itself.
Fixed a bug where the command line could show IDE-only meant for debugging
PluginBase.getLints now receive a ResolvedUnitResult instead of a LibraryElement.
PluginBase.getLints now receive a ResolvedUnitResult instead of a LibraryElement.
Compilation errors are now visible within the pubspec.yaml of applications that are using the plugin.
Compilation errors are now visible within the pubspec.yaml of applications
that are using the plugin.
Plugins that are currently loading are now highlighted inside the pubspec.yaml
of applications that are using the plugin.
If a plugin throws when trying to analyze a Dart file, the IDE will now show the exception at the top of the analyzed file.
Compilation errors, exceptions and prints are now accessible within
a log file (custom_lint.log) inside applications using the plugin.
Your coding agent can read these notes before it upgrades. Set up the MCP server →