Coding Standards
The aim for our frontend coding standards is to achieve the following goals:
- simple, clean, readable
- modular / component approach - always consider reusability and portability
- one method, one thing
- accessibility
- mobile first
- progressive enhancement - consider performance on different devices
- CSS naming conventions - we use BEM structure
What good code should have
- follow coding Style
- follow guidelines provided above
- indentation 2 spaces
- have onboarding documentation
- brief statement in file header
- at least one line of comment for code block description
- remove commented code and log
- no error logging
- no error message in console
- follow security best practices
- avoid issues such as cross-site scripting vulnerabilities
- implementation
- matches story acceptance criteria
- matches design across breakpoint
- pass Level1 browsers & devices
See our production requirements for more in-depth information on the tooling and approaches that should be undertaken before an application enters production.
Tooling
We use the following tooling to ensure coding standards across our frontend projects,