Custom_lint: write lints and fixes
summary
Shows how to build a real Dart lint with custom_lint and the package-side custom_lint_builder, using Riverpod-style annotations as the motivating example. Implements a rule that checks classes either missing or incorrectly extending the generated _${ClassName} pattern, adds a quick fix that inserts or replaces the extends clause, and demonstrates hot-reload, VM attach for debugging and prints. Tests use the expect_lint pattern and CI runs via dart run custom_lint; the live demo takes ~20 minutes and works end-to-end.
AI-written summary · about
chapters (6)
- 0:00Introduction to custom lint
- 1:28Setting up a basic lint rule
- 8:08Detecting class declarations
- 13:05Adding logic to the lint
- 14:29Creating a quick fix
- 21:40Testing the lint rule








