Linting, Formatting, and pana Score
Pass analysis and earn pub points.
Linting, Formatting, and pana Score is a free Dart Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Dart Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Quality Tools Before Publishing
Before you ship, Dart gives you tools to polish your code automatically. Quality checks catch issues early and make your package look professional. 🧹
Format Code With dart format
The dart format command rewrites your files to the official style. Consistent spacing and line breaks happen instantly, ending all formatting debates.
dart format .Static Analysis With dart analyze
Run dart analyze to find errors, warnings, and risky patterns without running your code. It reads like a careful reviewer that never tires.
dart analyzeConfigure Rules in analysis_options
The analysis_options.yaml file controls which lint rules apply. You opt in to stricter checks or relax ones that do not fit your project.
include: package:lints/recommended.yamlLints Are Best-Practice Hints
A lint is a style or correctness suggestion, not a hard error. Following recommended lints keeps your code idiomatic and easier for others to read.
Adopt a Lint Package
Most packages include the lints package and pick its recommended set. One line in analysis_options gives you a curated, community-trusted rule list.
Meet pana, the Package Analyzer
The pana tool mirrors exactly how pub.dev scores your package. Running it locally shows your grade before anyone else sees it.
dart pub global run pana .What the pub.dev Score Measures
Your pub points reward following conventions, documenting the API, passing analysis, and supporting platforms. Each category adds up to a public total.
Fix Warnings, Not Just Errors
Aim for a clean analyze run with zero warnings. pana deducts points for issues, so clearing them directly raises your visible score.
Automate Checks in CI
Run format, analyze, and tests in your CI pipeline. Every push gets verified the same way, so problems never slip into a release. 🤖
A Pre-Publish Checklist
Right before publishing, run format, analyze, test, and pana together. This quick checklist turns surprises at upload time into a calm, predictable release.
Quick Check
Which tool reproduces the exact scoring that pub.dev assigns to your package?
Recap: Polished and Scored
You can now format, analyze, lint, and run pana to preview pub points. Clean code today means a higher score tomorrow. ✅
Frequently asked questions
Is the “Linting, Formatting, and pana Score” lesson free?
Yes — the full text of “Linting, Formatting, and pana Score” is free to read here on the web, and the Dart Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Dart Academy course, upgrade to CoddyKit PRO.
What will I learn in “Linting, Formatting, and pana Score”?
Pass analysis and earn pub points. You practise Dart Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Dart Academy?
No prior experience is required. Dart Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Linting, Formatting, and pana Score” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Dart Academy lesson?
Yes. Every Dart Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Structuring a Publishable Library
- Documenting With dartdoc Comments
- Linting, Formatting, and pana Score
- dart pub publish to pub.dev