Turn Your Architecture into Lint Rules
summary
Shows how to turn team conventions into real Dart/Flutter lint rules that the analyzer enforces: build a plugin using the Dart analyzer API (AST vs resolved units), register a rule like no_api_client_in_bloc that forbids API client imports in bloc files, add unit tests and an autofix, and run checks automatically via hooks so an LLM agent iterates until analysis passes. Notes a typical CI/local overhead (~20s), recommends clear messages, severity stages, and using pub.dev packages and dart analyze then dart fix apply.
AI-written summary · about
chapters (24)
- 0:00Introduction and presenters
- 1:03Where conventions live today
- 2:08Why use lint rules
- 3:51Workflow with lint rules
- 4:35Demo of local agent workflow
- 6:22How analyzer sees code
- 7:03Syntax vs semantics in lint rules
- 9:30Structure of a lint rule
- 14:46Debugging lint rules
- 15:30Writing fixes for rules
- 16:55Combining lint plugins
- 18:19Anatomy of a good rule
- 19:22Crafting effective messages
- 20:04Rule severity levels
- 21:29Prompting agents for rules
- 22:12When to automate conventions
- 23:16Avoiding overly restrictive rules
- 23:58Performance impact of rules
- 25:04Optimizing rule execution
- 27:11Trade-offs of action loops
- 28:16Recommended lint packages
- 30:06Where to start implementing
- 31:52Next steps for teams
- 32:14Three key takeaways
