Opinionated Angular style guide for teams by John Papa. This is the most widely adopted Angular style guide (26k+ stars), endorsed by the Angular team. It provides conventions for building Angular applications — syntax, structure, naming, and patterns — with Why? explanations for every recommendation.
This is a documentation-only repository. There is no source code, no build system, no test framework, and no runtime dependencies. The deliverables are markdown files.
angular-styleguide/
├── README.md # Root — links to version-specific guides
├── a1/ # Angular 1 (AngularJS) style guide
│ ├── README.md # The full Angular 1 guide (~3,300 lines)
│ ├── assets/ # Images, code snippets, editor templates
│ └── i18n/ # Community translations (15+ languages)
├── a2/ # Angular 2+ style guide
│ ├── README.md # Angular 2 guide (references official docs)
│ └── notes.md # Development notes
├── LICENSE # MIT
└── .github/ # GitHub configuration (AI-ready assets)
- Content format: Markdown
- No runtime, build system, or test framework — this is a documentation project
There is no build step. The content is read directly on GitHub or cloned locally. To preview markdown locally, use any markdown viewer or VS Code preview.
There are no automated tests. Validation is manual:
- Read the markdown for accuracy and completeness
- Verify code examples compile and follow the conventions they describe
- Check that links are not broken
- The Why? pattern — every rule has one or more
*Why?*:bullets explaining the rationale - Style IDs — each rule has a unique ID (e.g.,
[Style Y001]) for easy reference - Avoid / Recommended — code examples show both the wrong way (
/* avoid */) and the right way (/* recommended */) - LIFT principle — Locate, Identify, Flat, Try DRY (Y140-Y144)
- ATX headings —
#,##,###for structure - Back to top links —
**[Back to top](#table-of-contents)**after each section
- Choose the appropriate guide (
a1/README.mdfor AngularJS,a2/README.mdfor Angular 2+) - Assign a new Style ID following the numbering convention (e.g.,
Y250for the next in sequence) - Write the rule with:
- A descriptive heading
- The style ID as a subheading:
###### [Style [Y250](#style-y250)] - One or more
*Why?*:bullets /* avoid */and/* recommended */code examples
- Add a
**[Back to top](#table-of-contents)**link at the end - Add the rule to the Table of Contents at the top of the guide
- If the rule applies across languages, update translations in
a1/i18n/
This project is documentation. The guides live in:
a1/README.md— Angular 1 style guide (primary, most complete)a2/README.md— Angular 2+ style guide (references official Angular docs)
Translations are maintained by the community in a1/i18n/.
- Don't forget the Table of Contents — every new rule must be added to the TOC at the top of the guide
- Translations go stale — when updating
a1/README.md, the 15+ translations ina1/i18n/may need updates. Flag this in the PR but don't auto-update translations. - Code examples must be valid — the
/* avoid */and/* recommended */examples should be syntactically correct JavaScript/TypeScript - Default branch is
master— notmain