Skip to content

Commit 26f2d7b

Browse files
Enable prettier rules during PR verification
1 parent 51ea927 commit 26f2d7b

File tree

540 files changed

+4238
-3001
lines changed

Some content is hidden

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

540 files changed

+4238
-3001
lines changed

.github/workflows/pr-verification.yml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -167,39 +167,38 @@ jobs:
167167
echo "✅ **Build verification passed!** The site is ready for deployment." >> $GITHUB_STEP_SUMMARY
168168
working-directory: ${{ env.BUILD_PATH }}
169169

170-
# Temporarily disabled
171-
# lint-and-format:
172-
# name: Code Quality Checks
173-
# runs-on: ubuntu-latest
174-
# if: github.event.pull_request.draft == false
175-
#
176-
# steps:
177-
# - name: Checkout
178-
# uses: actions/checkout@v4
179-
#
180-
# - name: Setup Node
181-
# uses: actions/setup-node@v4
182-
# with:
183-
# node-version: "20"
184-
# # Disable cache since we're manually clearing everything
185-
#
186-
# - name: Install dependencies
187-
# run: |
188-
# # Clear npm cache to avoid platform-specific binary issues
189-
# npm cache clean --force
190-
# # Remove package-lock.json and node_modules to fix Rollup optional dependency issue
191-
# rm -rf package-lock.json node_modules
192-
# # Fresh install
193-
# npm install
194-
# working-directory: ${{ env.BUILD_PATH }}
195-
#
196-
# - name: Run Prettier format check
197-
# run: |
198-
# # Check if code is properly formatted
199-
# npx prettier --check ./src
200-
# working-directory: ${{ env.BUILD_PATH }}
201-
#
202-
# - name: TypeScript type check
203-
# run: |
204-
# npx astro check
205-
# working-directory: ${{ env.BUILD_PATH }}
170+
lint-and-format:
171+
name: Code Quality Checks
172+
runs-on: ubuntu-latest
173+
if: github.event.pull_request.draft == false
174+
175+
steps:
176+
- name: Checkout
177+
uses: actions/checkout@v4
178+
179+
- name: Setup Node
180+
uses: actions/setup-node@v4
181+
with:
182+
node-version: "20"
183+
# Disable cache since we're manually clearing everything
184+
185+
- name: Install dependencies
186+
run: |
187+
# Clear npm cache to avoid platform-specific binary issues
188+
npm cache clean --force
189+
# Remove package-lock.json and node_modules to fix Rollup optional dependency issue
190+
rm -rf package-lock.json node_modules
191+
# Fresh install
192+
npm install
193+
working-directory: ${{ env.BUILD_PATH }}
194+
195+
- name: Run Prettier format check
196+
run: |
197+
# Check if code is properly formatted
198+
npx prettier --check ./src
199+
working-directory: ${{ env.BUILD_PATH }}
200+
201+
- name: TypeScript type check
202+
run: |
203+
npx astro check
204+
working-directory: ${{ env.BUILD_PATH }}

src/components/primer/PrimerHeading.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
1-
import React from 'react';
2-
import type { ReactNode } from 'react';
1+
import React from "react";
2+
import type { ReactNode } from "react";
33

44
interface PrimerHeadingProps {
55
level?: 1 | 2 | 3 | 4 | 5 | 6;
6-
size?: 'display' | '1' | '2' | '3' | '4' | '5' | '6' | 'subhead-large' | 'subhead-medium';
6+
size?:
7+
| "display"
8+
| "1"
9+
| "2"
10+
| "3"
11+
| "4"
12+
| "5"
13+
| "6"
14+
| "subhead-large"
15+
| "subhead-medium";
716
children: ReactNode;
817
className?: string;
918
}
1019

11-
export default function PrimerHeading({
12-
level = 2,
13-
size = '3',
14-
children,
15-
className = ''
20+
export default function PrimerHeading({
21+
level = 2,
22+
size = "3",
23+
children,
24+
className = "",
1625
}: PrimerHeadingProps) {
1726
// Use dynamic import for client-side rendering
1827
const [Heading, setHeading] = React.useState<any>(null);
19-
28+
2029
React.useEffect(() => {
2130
async function loadHeading() {
2231
try {
23-
const { Heading: PrimerHeading } = await import('@primer/react-brand');
32+
const { Heading: PrimerHeading } = await import("@primer/react-brand");
2433
setHeading(() => PrimerHeading);
2534
} catch (error) {
26-
console.error('Failed to load Primer Heading:', error);
35+
console.error("Failed to load Primer Heading:", error);
2736
}
2837
}
2938
loadHeading();
3039
}, []);
3140

3241
if (!Heading) {
3342
// Fallback to regular heading element
34-
const Tag = `h${level}` as 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
43+
const Tag = `h${level}` as "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
3544
return React.createElement(Tag, { className }, children);
3645
}
3746

src/components/primer/PrimerText.tsx

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,44 @@
1-
import React from 'react';
2-
import type { ReactNode } from 'react';
1+
import React from "react";
2+
import type { ReactNode } from "react";
33

44
interface PrimerTextProps {
5-
size?: '100' | '200' | '300' | '350' | '400' | '500' | '600' | '700' | '800' | '900' | '1000';
6-
weight?: 'light' | 'normal' | 'medium' | 'semibold';
7-
variant?: 'default' | 'muted';
5+
size?:
6+
| "100"
7+
| "200"
8+
| "300"
9+
| "350"
10+
| "400"
11+
| "500"
12+
| "600"
13+
| "700"
14+
| "800"
15+
| "900"
16+
| "1000";
17+
weight?: "light" | "normal" | "medium" | "semibold";
18+
variant?: "default" | "muted";
819
children: ReactNode;
920
className?: string;
10-
as?: 'p' | 'span' | 'div';
21+
as?: "p" | "span" | "div";
1122
}
1223

13-
export default function PrimerText({
14-
size = '400',
15-
weight = 'normal',
16-
variant = 'default',
17-
children,
18-
className = '',
19-
as = 'p'
24+
export default function PrimerText({
25+
size = "400",
26+
weight = "normal",
27+
variant = "default",
28+
children,
29+
className = "",
30+
as = "p",
2031
}: PrimerTextProps) {
2132
// Use dynamic import for client-side rendering
2233
const [Text, setText] = React.useState<any>(null);
23-
34+
2435
React.useEffect(() => {
2536
async function loadText() {
2637
try {
27-
const { Text: PrimerText } = await import('@primer/react-brand');
38+
const { Text: PrimerText } = await import("@primer/react-brand");
2839
setText(() => PrimerText);
2940
} catch (error) {
30-
console.error('Failed to load Primer Text:', error);
41+
console.error("Failed to load Primer Text:", error);
3142
}
3243
}
3344
loadText();
@@ -39,10 +50,10 @@ export default function PrimerText({
3950
}
4051

4152
return (
42-
<Text
43-
size={size}
44-
weight={weight}
45-
variant={variant}
53+
<Text
54+
size={size}
55+
weight={weight}
56+
variant={variant}
4657
as={as}
4758
className={className}
4859
>

src/components/primer/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { default as PrimerHeading } from './PrimerHeading';
2-
export { default as PrimerText } from './PrimerText';
1+
export { default as PrimerHeading } from "./PrimerHeading";
2+
export { default as PrimerText } from "./PrimerText";

src/config/menu.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"name": "Linkedin",
5252
"url": "https://www.linkedin.com/in/martinwoodward"
5353
},
54-
{
54+
{
5555
"name": "Twitter",
5656
"url": "https://x.com/martinwoodward"
5757
},

src/content/pages/elements.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ meta_title: ""
44
description: "this is meta description"
55
draft: false
66
---
7+
78
import { PrimerHeading, PrimerText } from "../../components/primer";
89
import Button from "../../layouts/shortcodes/Button.tsx";
910
import Notice from "../../layouts/shortcodes/Notice.tsx";
@@ -39,7 +40,8 @@ Here is an example of headings. You can use this heading by the following markdo
3940
</PrimerText>
4041

4142
<PrimerText size="400" weight="normal">
42-
This is normal text using Primer React components. The size is 400 which is a good default for body text.
43+
This is normal text using Primer React components. The size is 400 which is a
44+
good default for body text.
4345
</PrimerText>
4446

4547
<PrimerText size="300" weight="light" variant="muted">

src/content/pages/rss.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Stay updated with the latest posts by subscribing to our RSS feeds. Choose the f
1212
## Main Feeds
1313

1414
### [All Posts RSS Feed](/rss.xml)
15+
1516
Subscribe to get all published blog posts delivered to your RSS reader.
1617

1718
# Category Feeds
@@ -21,7 +22,7 @@ You can also subscribe to specific category feeds to get posts only from topics
2122
- Photography: `/rss/photography.xml`
2223
- Test: `/rss/test.xml`
2324

24-
*Note: Category feeds are automatically generated based on the categories used in blog posts. Replace spaces with hyphens and use lowercase letters in the URL.*
25+
_Note: Category feeds are automatically generated based on the categories used in blog posts. Replace spaces with hyphens and use lowercase letters in the URL._
2526

2627
## How to Use RSS Feeds
2728

src/content/post/2000/01/2000-01-12-ba-miles.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ tags: ["blog", "archive"]
1414
type: "regular" # available type (regular or featured)
1515
draft: false
1616
---
17-
This site is noteworthy as it was the first live deployment of a jsp page on the BA site - before then it was all jhtml. Other than that not really proud of this one as I had 4 days to get it designed, written, tested and live due to an upcoming marketing campaign that this site was supporting.
17+
18+
This site is noteworthy as it was the first live deployment of a jsp page on the BA site - before then it was all jhtml. Other than that not really proud of this one as I had 4 days to get it designed, written, tested and live due to an upcoming marketing campaign that this site was supporting.

src/content/post/2000/04/2000-04-12-online-checkin.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ tags: ["blog", "archive"]
1414
type: "regular" # available type (regular or featured)
1515
draft: false
1616
---
17-
Member of the team who produced the pioneering online check-in site for BA. Full J2EE n-tier application, however the best bit is the "little man" interface where you can click on a seat to select which seat you want and the little man moves. A shortcut feature is that you can actually type the number in an it moves the little man. This style of interface has been much re-used on other systems since it was done.
17+
18+
Member of the team who produced the pioneering online check-in site for BA. Full J2EE n-tier application, however the best bit is the "little man" interface where you can click on a seat to select which seat you want and the little man moves. A shortcut feature is that you can actually type the number in an it moves the little man. This style of interface has been much re-used on other systems since it was done.

src/content/post/2000/05/2000-05-20-html-editor.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ tags: ["blog", "archive"]
1414
type: "regular" # available type (regular or featured)
1515
draft: false
1616
---
17-
Demonstration of the [CONTENTEDITABLE](http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/contentEditable.asp) attribute that was introduced in IE 5.5 [Show Example](/sandbox/htmledit.html).
17+
18+
Demonstration of the [CONTENTEDITABLE](http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/contentEditable.asp) attribute that was introduced in IE 5.5 [Show Example](/sandbox/htmledit.html).

0 commit comments

Comments
 (0)