Skip to content

Commit

Permalink
Update CSS linting documentation for Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Aug 7, 2023
1 parent 9bc8c33 commit 0bb01c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/contributing/coding-standards/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ This makes it easier to keep track of different contexts.

To ensure code quality and consistency in our Sass files we check that certain rules are followed. These rules are based on [GDS Stylelint Config](https://github.com/alphagov/stylelint-config-gds/blob/main/scss.js), but we also add our own custom rules with a project [config file](/stylelint.config.js).

For consistent formatting we run [Prettier](https://prettier.io).

See [testing and linting](/docs/releasing/testing-and-linting.md) for more information.

## Running the lint task
Expand All @@ -125,6 +127,16 @@ To automatically fix Stylelint issues, add the `--fix` flag:
npm run lint:scss -- --fix
```

## Running the formatting task

You can run the formatter with `npm run lint:prettier`, or use formatting in [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and [other editors that support Prettier](https://prettier.io/docs/en/editors.html)

To automatically fix Prettier issues in all supported files, add the `--write` flag:

```shell
npm run lint:prettier -- --write
```

## Linting rules

We use the following rules when linting files:
Expand Down

0 comments on commit 0bb01c6

Please sign in to comment.