Skip to content

Commit 4d7b315

Browse files
Add linting and formatting, lint and format files (#234)
This PR does a bit of general tidying up: - Replaced `rimraf` with an event that fires on `eleventy.before` `build` events and uses Node’s `fs.rm` method to clean out destination directory instead - Removed unused dependencies (`sass` and `standard`) - Updated `package.json` metadata - Removed unused `netlify.toml` config (we don’t host the site on Netlify) - Fixed front matter for the Mission patches page so that the correct title and description is shown on the sitemap (currently says `{{ title }}` and `{{ description }}` - Removed temporary files in image folders which are creating empty entries in the sitemap - Updated links that point to entries on previous `designhistory.app` domain - Relatedly, fixed broken links that assumed entries had the same root path - Optimised images (reducing total image directory size from 163 MB to 136 MB… worth it, not sure!) - Fixed malformed Markdown (spotted some incorrect syntax for links and headings) - Fixed malformed YAML front matter - Added linting tasks and configuration; these don’t run automatically, perhaps we can decide how, if and when we want to run these - Formated Markdown, YAML, JSON, JavaScript and SCSS files using Prettier - Linted JavaScript using ESLint - Linted SCSS using Stylelint - Removed the screenshot scripts; do anyone use these? - In addition to formatting Markdown files with Prettier, and fixing malformed Markdown, tweaked syntax where better alternative available. Examples include: - using figure caption instead of a paragraph of bold text before an image - changing heading levels to always start at level 2 - see e842006 Only done this in a few places, where spotted issues, but thought it was worth pointing out all the same.
1 parent 6ddd7c3 commit 4d7b315

File tree

827 files changed

+4934
-4999
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

827 files changed

+4934
-4999
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
version: 2
22
updates:
3-
- package-ecosystem: npm
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
open-pull-requests-limit: 10
8-
ignore:
9-
- dependency-name: markdown-it-anchor
10-
versions:
11-
- 7.0.0
12-
- 7.0.1
13-
- 7.0.2
14-
- package-ecosystem: "github-actions"
15-
directory: "/"
16-
schedule:
17-
interval: "weekly"
3+
- package-ecosystem: npm
4+
directory: '/'
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
ignore:
9+
- dependency-name: markdown-it-anchor
10+
versions:
11+
- 7.0.0
12+
- 7.0.1
13+
- 7.0.2
14+
- package-ecosystem: 'github-actions'
15+
directory: '/'
16+
schedule:
17+
interval: 'weekly'
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# For most projects, this workflow file will not need changing; you simply need
22
# to commit it to your repository.
33
#
4-
# You may wish to alter this file to override the set of languages analyzed,
4+
# You may wish to alter this file to override the set of languages analysed,
55
# or to provide custom queries or build logic.
66
#
77
# ******** NOTE ********
88
# We have attempted to detect the languages in your repository. Please check
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: 'CodeQL'
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: [main]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main ]
19+
branches: [main]
2020
schedule:
2121
- cron: '38 15 * * 3'
2222

@@ -32,39 +32,39 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript' ]
36-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
35+
language: ['javascript']
36+
# CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby']
3737
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3838

3939
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v5
40+
- name: Checkout repository
41+
uses: actions/checkout@v5
4242

43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54-
# If this step fails, then you should remove it and run the build manually (see below)
55-
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v3
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v3
5757

58-
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
6060

61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
6464

65-
#- run: |
66-
# make bootstrap
67-
# make release
65+
#- run: |
66+
# make bootstrap
67+
# make release
6868

69-
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v3
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v3

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/*.html

.prettierrc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "none",
6+
"overrides": [
7+
{
8+
"files": "*.md",
9+
"options": {
10+
"embeddedLanguageFormatting": "off"
11+
}
12+
},
13+
{
14+
"files": "*.scss",
15+
"options": {
16+
"printWidth": 120,
17+
"singleQuote": false
18+
}
19+
}
20+
]
21+
}

.stylelintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "stylelint-config-gds/scss",
3+
"ignoreFiles": ["_site/**/*.css"]
4+
}

app/_components/email/_index.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
margin-bottom: nhsuk-spacing(8);
77
max-width: 40rem;
88

9-
h1, h2, h3, h4 {
9+
h1,
10+
h2,
11+
h3,
12+
h4 {
1013
@include nhsuk-font-size($size: 26);
1114
@include nhsuk-typography-weight-bold;
1215
margin-bottom: nhsuk-spacing(4);

app/guide/how-to-add-a-new-service.md

Lines changed: 7 additions & 7 deletions

app/guide/how-to-publish.md

Lines changed: 1 addition & 1 deletion

app/guide/using-markdown.md

Lines changed: 1 addition & 2 deletions

app/guide/what-to-include-in-a-design-history.md

Lines changed: 7 additions & 7 deletions

0 commit comments

Comments
 (0)