Skip to content

Commit a459447

Browse files
authored
chore: enforce consistent object-shorthand (#7851)
* chore: force object shorthand * chore: revert guid changes * chore: content stylings * fix: mixed object shorthand
1 parent a85673e commit a459447

File tree

31 files changed

+89
-67
lines changed

31 files changed

+89
-67
lines changed

apps/site/app/[locale]/next-data/api-data/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const GET = async () => {
4848
const deflatedSource = deflateSync(cleanedContent).toString('base64');
4949

5050
return {
51-
filename,
51+
filename: filename,
5252
pathname: getPathnameForApiFile(name, versionWithPrefix),
5353
content: deflatedSource,
5454
};

apps/site/app/[locale]/next-data/page-data/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ export const GET = async () => {
3535
const cleanedContent = parseRichTextIntoPlainText(matter(source).content);
3636

3737
// Deflates a String into a base64 string-encoded (zlib compressed)
38-
const deflatedSource = deflateSync(cleanedContent).toString('base64');
38+
const content = deflateSync(cleanedContent).toString('base64');
3939

4040
// Returns metadata of each page available on the Website
4141
return {
4242
filename,
4343
pathname,
4444
title,
4545
description,
46-
content: deflatedSource,
46+
content,
4747
};
4848
});
4949

apps/site/app/[locale]/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ const getPage: FC<DynamicParams> = async props => {
134134

135135
// Metadata and shared Context to be available through the lifecycle of the page
136136
const sharedContext = {
137-
frontmatter,
138-
headings,
137+
frontmatter: frontmatter,
138+
headings: headings,
139139
pathname: `/${pathname}`,
140-
readingTime,
141-
filename,
140+
readingTime: readingTime,
141+
filename: filename,
142142
};
143143

144144
// Defines a shared Server Context for the Client-Side

apps/site/components/Downloads/Release/VersionDropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ const VersionDropdown: FC = () => {
3838
);
3939

4040
if (release?.status === 'LTS' && pathname.includes('current')) {
41-
redirect({ href: '/download', locale });
41+
redirect({ href: '/download', locale: locale });
4242
return;
4343
}
4444

4545
if (release?.status === 'Current' && !pathname.includes('current')) {
46-
redirect({ href: '/download/current', locale });
46+
redirect({ href: '/download/current', locale: locale });
4747
return;
4848
}
4949

apps/site/components/withAvatarGroup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const WithAvatarGroup: FC<WithAvatarGroupProps> = ({
2121
}) => (
2222
<AvatarGroup
2323
avatars={getAuthors({
24-
usernames: usernames,
25-
names: names,
26-
clickable: clickable,
24+
usernames,
25+
names,
26+
clickable,
2727
})}
2828
as={Link}
2929
{...props}

apps/site/components/withBreadcrumbs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ const WithBreadcrumbs: FC<WithBreadcrumbsProps> = ({ navKeys = [] }) => {
5757
// Goes deeper on the tree of items if there are any.
5858
currentNode = items;
5959

60-
return label ? [...breadcrumbs, { label, href: link }] : breadcrumbs;
60+
return label
61+
? [...breadcrumbs, { label: label, href: link }]
62+
: breadcrumbs;
6163
}
6264

6365
return breadcrumbs;

apps/site/components/withFooter.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ const WithFooter: FC = () => {
2020
// Add OpenJS link
2121
updatedFooterLinks.push(footerLinks.at(-1)!);
2222

23-
const navigation = { socialLinks, footerLinks: updatedFooterLinks };
23+
const navigation = {
24+
socialLinks: socialLinks,
25+
footerLinks: updatedFooterLinks,
26+
};
2427

2528
return <Footer navigation={navigation} as={Link} pathname={pathname} />;
2629
};

apps/site/components/withNavBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ const WithNavBar: FC = () => {
4848

4949
<NavBar
5050
navItems={navigationItems.map(([, { label, link, target }]) => ({
51-
link,
51+
link: link,
5252
text: label,
53-
target,
53+
target: target,
5454
}))}
5555
pathname={pathname}
5656
as={Link}

apps/site/hooks/react-generic/useSiteNavigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const useSiteNavigation = () => {
4949
] => [
5050
key,
5151
{
52-
target,
52+
target: target,
5353
label: label ? getFormattedMessage(label, key) : '',
5454
link: link ? replaceLinkWithContext(link, context[key]) : '',
5555
items: items ? mapNavigationEntries(items, context) : [],

apps/site/i18n.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default getRequestConfig(async ({ requestLocale }) => {
3535
}
3636

3737
return {
38-
locale,
38+
locale: locale,
3939
// This is the dictionary of messages to be loaded
4040
messages: await loadLocaleDictionary(locale),
4141
// We always define the App timezone as UTC

0 commit comments

Comments
 (0)