custom lint issues - performance and configuration.

7 views
Skip to first unread message

Brett Sutton

unread,
Jan 15, 2026, 5:41:01 PM (2 days ago) Jan 15
to Dart Analyzer Discussion
I've just ported a couple  of custom lints from the custom_lint package to the new dart analyzer package v9.

I'm having two issues.

1. Performance. 
On a tiny example project (the one in the below source link) dart analyze takes 0.1s to run. As soon as I enable either of my lints (individually or together) the analysis takes over 20 s.

2. When using the custom_lint package, If as user add the lint_hard package as a dependency, my custom lints were automatically enabled without the user having to define a plugin in the analysis_options.yaml.  After the migration users now have to define the plugin as well as each individual custom lint.  This seems unnecessarily complex for users of the my package - it also means that they will need to modify the plugins section each time I ship a new custom lint which will probably mean the will go not being activated.

Here is the source:


Brett Sutton

unread,
Jan 15, 2026, 6:11:24 PM (2 days ago) Jan 15
to analyzer...@dartlang.org
Just a follow up, does the analyzer 'stream' the lints results. I feel like as soon as I add a custom lints, all the lints are delayed. 

Ideally the 'in built' lints would run and show in the ide (vs-code in my case) and then the custom lints continue to run in the background.
 
This is assuming that the performance issues can't be resolved.

--
You received this message because you are subscribed to the Google Groups "Dart Analyzer Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzer-discu...@dartlang.org.
To view this discussion visit https://groups.google.com/a/dartlang.org/d/msgid/analyzer-discuss/b89b7da0-81cd-4cb4-b488-47038d850e4an%40dartlang.org.

Samuel Rawlins

unread,
Jan 15, 2026, 6:13:36 PM (2 days ago) Jan 15
to Dart Analyzer Discussion, bsu...@onepub.dev
Thanks for the feedback! I have a few questions:

What version of Dart are you using? There is a notable startup improvement in Dart 3.11 (unreleased) or any Dart 3.11 beta version, I believe. It won't get you down to 0.1s on a fresh plugin build. And maybe even not on an incremental analysis. But it should be better.

Regarding the dependency question, that is a pretty cool feature of custom_lint, that you only have to add a dependency on a custom_lint-based package, and you get analysis. We might consider something like this in the future.

> users now have to define the plugin as well as each individual custom lint

To speak in terms of the new analyzer plugins, do you mean that you are delivering multiple packages as analyzer plugins, and users have to enable each one? That's true.

> users of the my package

Oops except maybe I got that wrong. Are you shipping one analyzer plugin or many?

> it also means that they will need to modify the plugins section each time I ship a new custom lint which will probably mean the will go not being activated.

This is also true. If it makes sense for users to use multiple warning rules and lint rules for one purpose, I would recommend shipping them all in one (or few, maybe) plugins. Is there another reason you are writing multiple analyzer plugins?

dark...@gmail.com

unread,
Jan 15, 2026, 6:24:24 PM (2 days ago) Jan 15
to Dart Analyzer Discussion, sraw...@google.com, bsu...@onepub.dev
With regards to enabling new lints by default:

If you define your rules using "registerWarning", they are on by default. This is likely what you're looking for.

Reply all
Reply to author
Forward
0 new messages