ONSdigital / design-system

ONS Design System
https://service-manual.ons.gov.uk/design-system
MIT License
27 stars 17 forks source link

Add formatting for Nunjucks files #3218

Open rmccar opened 1 month ago

rmccar commented 1 month ago

What is the context of this PR?

Fixes: #3169

Adds the Jinja plugin (prettier-plugin-jinja-template) to prettier and have then run prettier on all our Nunjucks files to format them correctly. I have also added them to the lint staging step so that they are formatted on the Husky pre commit hook. I have also fixed all errors and warnings from running prettier which has required some refactoring.

Some other fixes have gone in too:

How to review this PR

Checklist

This needs to be completed by the person raising the PR.

netlify[bot] commented 1 month ago

Deploy Preview for ons-design-system-preview ready!

Name Link
Latest commit e9ae2c1e0af60bd0cb226f2827285c3eaa597d2f
Latest deploy log https://app.netlify.com/sites/ons-design-system-preview/deploys/668416d7f07bd2000852321c
Deploy Preview https://deploy-preview-3218--ons-design-system-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.