Skip to content

Javascript standards

JavaScript standards

Use vanilla JavaScript, don't use extensions to the language such as TypeScript

Use Standard JS to lint your code

  • A consistent approach to code layout, spacing and formatting makes it easier to switch between projects.

By adding it as a dev dependency it can be easily used in the terminal, Webstorm, and Visual Studio.

Do not use front end JavaScript frameworks

  • Frameworks such as React, Angular, Vue etc go against progressive enhancement
  • Even frameworks that provide server-side rendering encourage and enable accidental use of client-side approaches, which violate the progressive enhancement principle
  • The GOV.UK Design System already provides a set of accessible components that support progressive enhancement

A service could make a case for using a framework to deliver a highly-functional progressive enhancement, for example an interactive map, but these must be managed as explicit exceptions to this standard.

Status

This standard was formally adopted on 1 July 2019.

Significant changes

Clarification on not using front end frameworks was added 1 December 2024.