Skip to content

Commit 80220d5

Browse files
committed
chore: lint
1 parent f7f1783 commit 80220d5

37 files changed

+1004
-337
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
npm run lint
55

66
# Run format before commit
7-
npm run format
7+
npm run lint-fix
88

99
# generate uml diagram before commit
1010
npm run uml

src/components/Accordion/Accordion.stories.tsx

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ let configured = false;
1515
const meta: Meta<typeof Accordion> = {
1616
title: "GOVUK Design System/Accordion",
1717
component: Accordion,
18-
decorators: [(Story, { parameters }) => {
18+
decorators: [
19+
(Story, { parameters }) => {
1920
React.useEffect(() => {
20-
const isDocsMode = window.location.search.includes("path=/docs/govuk-design-system-accordion--docs");
21+
const isDocsMode = window.location.search.includes(
22+
"path=/docs/govuk-design-system-accordion--docs",
23+
);
2124
if (isDocsMode && !configured && parameters.initializeConfigurations) {
2225
ConfigureOverallAccordion();
2326
configured = true;
@@ -26,7 +29,8 @@ const meta: Meta<typeof Accordion> = {
2629
}
2730
}, []);
2831
return <Story />;
29-
}],
32+
},
33+
],
3034
tags: ["autodocs"],
3135
};
3236

@@ -35,7 +39,8 @@ type Story = StoryObj<typeof Accordion>;
3539

3640
// extractShownFixtures transforms raw govuk-frontend fixture data into
3741
// React-compatible props (e.g. text → children, classes → className).
38-
const examplesFromFixtures: Array<ComponentFixture> = extractShownFixtures(fixtures);
42+
const examplesFromFixtures: Array<ComponentFixture> =
43+
extractShownFixtures(fixtures);
3944

4045
export const Default: Story = {
4146
name: "default",
@@ -44,15 +49,27 @@ export const Default: Story = {
4449

4550
export const WithAdditionalDescriptions: Story = {
4651
name: "with additional descriptions",
47-
args: { ...examplesFromFixtures.find((f) => f.name === "with additional descriptions")?.options },
52+
args: {
53+
...examplesFromFixtures.find(
54+
(f) => f.name === "with additional descriptions",
55+
)?.options,
56+
},
4857
};
4958

5059
export const WithLongContentAndDescription: Story = {
5160
name: "with long content and description",
52-
args: { ...examplesFromFixtures.find((f) => f.name === "with long content and description")?.options },
61+
args: {
62+
...examplesFromFixtures.find(
63+
(f) => f.name === "with long content and description",
64+
)?.options,
65+
},
5366
};
5467

5568
export const WithAllSectionsAlreadyOpen: Story = {
5669
name: "with all sections already open",
57-
args: { ...examplesFromFixtures.find((f) => f.name === "with all sections already open")?.options },
58-
};
70+
args: {
71+
...examplesFromFixtures.find(
72+
(f) => f.name === "with all sections already open",
73+
)?.options,
74+
},
75+
};

src/components/BackLink/BackLink.stories.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ import { ComponentFixture } from "../../dynamics";
1212
const meta: Meta<typeof BackLink> = {
1313
title: "GOVUK Design System/Back link",
1414
component: BackLink,
15-
decorators: [(Story) => {
15+
decorators: [
16+
(Story) => {
1617
return <Story />;
17-
}],
18+
},
19+
],
1820
tags: ["autodocs"],
1921
};
2022

@@ -23,7 +25,8 @@ type Story = StoryObj<typeof BackLink>;
2325

2426
// extractShownFixtures transforms raw govuk-frontend fixture data into
2527
// React-compatible props (e.g. text → children, classes → className).
26-
const examplesFromFixtures: Array<ComponentFixture> = extractShownFixtures(fixtures);
28+
const examplesFromFixtures: Array<ComponentFixture> =
29+
extractShownFixtures(fixtures);
2730

2831
export const Default: Story = {
2932
name: "default",
@@ -33,4 +36,4 @@ export const Default: Story = {
3336
export const Inverse: Story = {
3437
name: "inverse",
3538
args: { ...examplesFromFixtures.find((f) => f.name === "inverse")?.options },
36-
};
39+
};

src/components/Breadcrumbs/Breadcrumbs.stories.tsx

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ import { ComponentFixture } from "../../dynamics";
1212
const meta: Meta<typeof Breadcrumbs> = {
1313
title: "GOVUK Design System/Breadcrumbs",
1414
component: Breadcrumbs,
15-
decorators: [(Story) => {
15+
decorators: [
16+
(Story) => {
1617
return <Story />;
17-
}],
18+
},
19+
],
1820
tags: ["autodocs"],
1921
};
2022

@@ -23,7 +25,8 @@ type Story = StoryObj<typeof Breadcrumbs>;
2325

2426
// extractShownFixtures transforms raw govuk-frontend fixture data into
2527
// React-compatible props (e.g. text → children, classes → className).
26-
const examplesFromFixtures: Array<ComponentFixture> = extractShownFixtures(fixtures);
28+
const examplesFromFixtures: Array<ComponentFixture> =
29+
extractShownFixtures(fixtures);
2730

2831
export const Default: Story = {
2932
name: "default",
@@ -32,25 +35,37 @@ export const Default: Story = {
3235

3336
export const WithOneLevel: Story = {
3437
name: "with one level",
35-
args: { ...examplesFromFixtures.find((f) => f.name === "with one level")?.options },
38+
args: {
39+
...examplesFromFixtures.find((f) => f.name === "with one level")?.options,
40+
},
3641
};
3742

3843
export const WithoutTheHomeSection: Story = {
3944
name: "without the home section",
40-
args: { ...examplesFromFixtures.find((f) => f.name === "without the home section")?.options },
45+
args: {
46+
...examplesFromFixtures.find((f) => f.name === "without the home section")
47+
?.options,
48+
},
4149
};
4250

4351
export const WithLastBreadcrumbAsCurrentPage: Story = {
4452
name: "with last breadcrumb as current page",
45-
args: { ...examplesFromFixtures.find((f) => f.name === "with last breadcrumb as current page")?.options },
53+
args: {
54+
...examplesFromFixtures.find(
55+
(f) => f.name === "with last breadcrumb as current page",
56+
)?.options,
57+
},
4658
};
4759

4860
export const WithCollapseOnMobile: Story = {
4961
name: "with collapse on mobile",
50-
args: { ...examplesFromFixtures.find((f) => f.name === "with collapse on mobile")?.options },
62+
args: {
63+
...examplesFromFixtures.find((f) => f.name === "with collapse on mobile")
64+
?.options,
65+
},
5166
};
5267

5368
export const Inverse: Story = {
5469
name: "inverse",
5570
args: { ...examplesFromFixtures.find((f) => f.name === "inverse")?.options },
56-
};
71+
};

src/components/Button/Button.stories.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ let configured = false;
1515
const meta: Meta<typeof Button> = {
1616
title: "GOVUK Design System/Button",
1717
component: Button,
18-
decorators: [(Story, { parameters }) => {
18+
decorators: [
19+
(Story, { parameters }) => {
1920
React.useEffect(() => {
20-
const isDocsMode = window.location.search.includes("path=/docs/govuk-design-system-button--docs");
21+
const isDocsMode = window.location.search.includes(
22+
"path=/docs/govuk-design-system-button--docs",
23+
);
2124
if (isDocsMode && !configured && parameters.initializeConfigurations) {
2225
ConfigureOverallButton();
2326
configured = true;
@@ -26,7 +29,8 @@ const meta: Meta<typeof Button> = {
2629
}
2730
}, []);
2831
return <Story />;
29-
}],
32+
},
33+
],
3034
tags: ["autodocs"],
3135
};
3236

@@ -35,7 +39,8 @@ type Story = StoryObj<typeof Button>;
3539

3640
// extractShownFixtures transforms raw govuk-frontend fixture data into
3741
// React-compatible props (e.g. text → children, classes → className).
38-
const examplesFromFixtures: Array<ComponentFixture> = extractShownFixtures(fixtures);
42+
const examplesFromFixtures: Array<ComponentFixture> =
43+
extractShownFixtures(fixtures);
3944

4045
export const Default: Story = {
4146
name: "default",
@@ -59,7 +64,9 @@ export const Start: Story = {
5964

6065
export const Secondary: Story = {
6166
name: "secondary",
62-
args: { ...examplesFromFixtures.find((f) => f.name === "secondary")?.options },
67+
args: {
68+
...examplesFromFixtures.find((f) => f.name === "secondary")?.options,
69+
},
6370
};
6471

6572
export const Warning: Story = {
@@ -70,4 +77,4 @@ export const Warning: Story = {
7077
export const Inverse: Story = {
7178
name: "inverse",
7279
args: { ...examplesFromFixtures.find((f) => f.name === "inverse")?.options },
73-
};
80+
};

src/components/CharacterCount/CharacterCount.stories.tsx

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ let configured = false;
1515
const meta: Meta<typeof CharacterCount> = {
1616
title: "GOVUK Design System/Character count",
1717
component: CharacterCount,
18-
decorators: [(Story, { parameters }) => {
18+
decorators: [
19+
(Story, { parameters }) => {
1920
React.useEffect(() => {
20-
const isDocsMode = window.location.search.includes("path=/docs/govuk-design-system-character-count--docs");
21+
const isDocsMode = window.location.search.includes(
22+
"path=/docs/govuk-design-system-character-count--docs",
23+
);
2124
if (isDocsMode && !configured && parameters.initializeConfigurations) {
2225
ConfigureOverallCharacterCount();
2326
configured = true;
@@ -26,7 +29,8 @@ const meta: Meta<typeof CharacterCount> = {
2629
}
2730
}, []);
2831
return <Story />;
29-
}],
32+
},
33+
],
3034
tags: ["autodocs"],
3135
};
3236

@@ -35,7 +39,8 @@ type Story = StoryObj<typeof CharacterCount>;
3539

3640
// extractShownFixtures transforms raw govuk-frontend fixture data into
3741
// React-compatible props (e.g. text → children, classes → className).
38-
const examplesFromFixtures: Array<ComponentFixture> = extractShownFixtures(fixtures);
42+
const examplesFromFixtures: Array<ComponentFixture> =
43+
extractShownFixtures(fixtures);
3944

4045
export const Default: Story = {
4146
name: "default",
@@ -44,40 +49,61 @@ export const Default: Story = {
4449

4550
export const WithHint: Story = {
4651
name: "with hint",
47-
args: { ...examplesFromFixtures.find((f) => f.name === "with hint")?.options },
52+
args: {
53+
...examplesFromFixtures.find((f) => f.name === "with hint")?.options,
54+
},
4855
};
4956

5057
export const WithHintAndError: Story = {
5158
name: "with hint and error",
52-
args: { ...examplesFromFixtures.find((f) => f.name === "with hint and error")?.options },
59+
args: {
60+
...examplesFromFixtures.find((f) => f.name === "with hint and error")
61+
?.options,
62+
},
5363
};
5464

5565
export const WithDefaultValue: Story = {
5666
name: "with default value",
57-
args: { ...examplesFromFixtures.find((f) => f.name === "with default value")?.options },
67+
args: {
68+
...examplesFromFixtures.find((f) => f.name === "with default value")
69+
?.options,
70+
},
5871
};
5972

6073
export const WithDefaultValueExceedingLimit: Story = {
6174
name: "with default value exceeding limit",
62-
args: { ...examplesFromFixtures.find((f) => f.name === "with default value exceeding limit")?.options },
75+
args: {
76+
...examplesFromFixtures.find(
77+
(f) => f.name === "with default value exceeding limit",
78+
)?.options,
79+
},
6380
};
6481

6582
export const WithCustomRows: Story = {
6683
name: "with custom rows",
67-
args: { ...examplesFromFixtures.find((f) => f.name === "with custom rows")?.options },
84+
args: {
85+
...examplesFromFixtures.find((f) => f.name === "with custom rows")?.options,
86+
},
6887
};
6988

7089
export const WithLabelAsPageHeading: Story = {
7190
name: "with label as page heading",
72-
args: { ...examplesFromFixtures.find((f) => f.name === "with label as page heading")?.options },
91+
args: {
92+
...examplesFromFixtures.find((f) => f.name === "with label as page heading")
93+
?.options,
94+
},
7395
};
7496

7597
export const WithWordCount: Story = {
7698
name: "with word count",
77-
args: { ...examplesFromFixtures.find((f) => f.name === "with word count")?.options },
99+
args: {
100+
...examplesFromFixtures.find((f) => f.name === "with word count")?.options,
101+
},
78102
};
79103

80104
export const WithThreshold: Story = {
81105
name: "with threshold",
82-
args: { ...examplesFromFixtures.find((f) => f.name === "with threshold")?.options },
83-
};
106+
args: {
107+
...examplesFromFixtures.find((f) => f.name === "with threshold")?.options,
108+
},
109+
};

0 commit comments

Comments
 (0)