Skip to content

Investigate how we can lint or format code blocks inside documentation #474

Open
@romaricpascal

Description

@romaricpascal

What

Investigate which tools we could use to format or lint the code blocks inside our documentation. We have set up Prettier, ESLint and Stylelint for that on GOV.UK Frontend, as well as one the Design System site (with the same Prettier configuration, but a slight variation for ESLint and a slight variation for Stylelint as well).

Using the same set up here would be ideal, but one thing to account for here is that the content is not set up in plain Markdown files, but processed as an ERB template, so may cause issues with ESLint and or Prettier.

Why

This would help pick up typos or when the code has formatting issues (like smart quotes instead of regular ones).

Who needs to know about this

Developers

Done when

  • We've investigated to which extent we can use a similar set up as on GOV.UK Frontend or the Design System site (possibly with configuration changes to account for the use of ERB)
  • If in need of another solution, we've investigated which other tool could help us keep a consisten formatting of our code blocks in the documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions