Skip to content

Conversation

@colinrotherham
Copy link
Contributor

@colinrotherham colinrotherham commented Sep 15, 2025

Description

This PR configures Stylelint using the GOV.UK Frontend config

These changes make sure to reduce the "diff" between our two repos

Missing properties have been added for flex, grid and column layouts (plus masks)

Automatic grouping

Support for automatic grouping was added in [email protected] using emptyLineBefore: 'threshold'

Sass files in NHS.UK frontend are manually now automatically split up into groups:

    box-sizing: border-box;
+ 
    display: inline-block;
+
    width: $indicator-size;
    height: $indicator-size;
    margin: 0 0.125em;
+
    border-width: 2px;
    border-style: solid;
    border-radius: 50%;

i.e. One less thing to fix manually when saving files

Format on save

Visual Studio code can be configured to automatically apply ESLint, Stylelint and Prettier formatting:

"editor.codeActionsOnSave": {
  "source.fixAll.eslint": "explicit",
  "source.fixAll.stylelint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.requireConfig": true,
"stylelint.validate": ["css", "scss"],

Checklist

@colinrotherham colinrotherham temporarily deployed to nhsuk-frontend-pr-1589 September 15, 2025 14:04 Inactive
@sonarqubecloud
Copy link

Copy link
Contributor

@paulrobertlloyd paulrobertlloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Should help keep diffs much more manageable.

Copy link
Contributor

@anandamaryon1 anandamaryon1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

(will apply to my VS code now, and hopefully never have to push another fix linting commit again)

@colinrotherham colinrotherham merged commit 8c94f6a into main Sep 15, 2025
25 of 26 checks passed
@colinrotherham colinrotherham deleted the stylelint-order branch September 15, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants