Skip to content

Commit bc77afb

Browse files
committed
chore: moved components to correct places and standardises array types
1 parent ce748e1 commit bc77afb

File tree

39 files changed

+52
-47
lines changed

39 files changed

+52
-47
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"parser": "@typescript-eslint/parser",
5151
"rules": {
5252
"@typescript-eslint/consistent-type-imports": "error",
53+
"@typescript-eslint/array-type": ["error", { "default": "generic" }],
5354
"no-relative-import-paths/no-relative-import-paths": [
5455
"warn",
5556
{ "allowSameFolder": true, "prefix": "@" }

app/[locale]/[[...path]]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { dynamicRouter } from '@/next.dynamic.mjs';
1212
import { availableLocaleCodes, defaultLocale } from '@/next.locales.mjs';
1313
import { MatterProvider } from '@/providers/matterProvider';
1414

15-
type DynamicStaticPaths = { path: string[]; locale: string };
15+
type DynamicStaticPaths = { path: Array<string>; locale: string };
1616
type DynamicParams = { params: DynamicStaticPaths };
1717

1818
// This is the default Viewport Metadata
@@ -38,7 +38,7 @@ export const generateMetadata = async ({ params }: DynamicParams) => {
3838
// This provides all the possible paths that can be generated statically
3939
// + provides all the paths that we support on the Node.js Website
4040
export const generateStaticParams = async () => {
41-
const paths: DynamicStaticPaths[] = [];
41+
const paths: Array<DynamicStaticPaths> = [];
4242

4343
// We don't need to compute all possible paths on regular builds
4444
// as we benefit from Next.js's ISR (Incremental Static Regeneration)

app/sitemap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const baseUrlAndPath = `${BASE_URL}${BASE_PATH}`;
1515
// Next.js Sitemap Generation doesn't support `alternate` refs yet
1616
// @see https://github.com/vercel/next.js/discussions/55646
1717
const sitemap = async (): Promise<MetadataRoute.Sitemap> => {
18-
const paths: string[] = [];
18+
const paths: Array<string> = [];
1919

2020
for (const locale of availableLocaleCodes) {
2121
const routes = await dynamicRouter.getRoutesByLanguage(locale);

components/Common/AvatarGroup/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { getAcronymFromString } from '@/util/stringUtils';
99
import styles from './index.module.css';
1010

1111
type AvatarGroupProps = {
12-
avatars: ComponentProps<typeof Avatar>[];
12+
avatars: Array<ComponentProps<typeof Avatar>>;
1313
limit?: number;
1414
isExpandable?: boolean;
1515
};

components/Common/BlogPostCard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type BlogPostCardProps = {
1717
title: ComponentProps<typeof Preview>['title'];
1818
type: Required<ComponentProps<typeof Preview>>['type'];
1919
description: string;
20-
authors: Author[];
20+
authors: Array<Author>;
2121
date: Date;
2222
};
2323

components/Common/Breadcrumbs/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type BreadcrumbLink = {
1313
};
1414

1515
type BreadcrumbsProps = {
16-
links: BreadcrumbLink[];
16+
links: Array<BreadcrumbLink>;
1717
maxLength?: number;
1818
hideHome?: boolean;
1919
};

components/Common/LanguageDropDown/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type SimpleLocaleConfig = Pick<LocaleConfig, 'name' | 'code'>;
1313
type LanguageDropDownProps = {
1414
onChange?: (newLocale: SimpleLocaleConfig) => void;
1515
currentLanguage: string;
16-
availableLanguages: SimpleLocaleConfig[];
16+
availableLanguages: Array<SimpleLocaleConfig>;
1717
};
1818

1919
const LanguageDropdown: FC<LanguageDropDownProps> = ({

components/Common/Pagination/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type Page = { url: string };
1212
type PaginationProps = {
1313
// One-based number of the current page
1414
currentPage: number;
15-
pages: Page[];
15+
pages: Array<Page>;
1616
// The number of page buttons on each side of the current page button
1717
// @default 1
1818
currentPageSiblingsCount?: number;

components/Common/Pagination/useGetPageElements.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ const parsePages = (
99
pages: ComponentProps<typeof Pagination>['pages'],
1010
currentPage: number,
1111
totalPages: number
12-
): PaginationListItemProps[] =>
12+
): Array<PaginationListItemProps> =>
1313
pages.map(({ url }, index) => ({
1414
url,
1515
pageNumber: index + 1,
1616
currentPage,
1717
totalPages,
1818
}));
1919

20-
const createPaginationListItems = (parsedPages: PaginationListItemProps[]) =>
21-
parsedPages.map(page => <PaginationListItem key={page.url} {...page} />);
20+
const createPaginationListItems = (
21+
parsedPages: Array<PaginationListItemProps>
22+
) => parsedPages.map(page => <PaginationListItem key={page.url} {...page} />);
2223

2324
// The minimum amount of elements are first page, current page, and last page
2425
const MINIMUM_AMOUNT_OF_ELEMENTS = 3;

components/Common/ProgressionSidebar/ProgressionSidebarGroup/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import styles from './index.module.css';
77

88
type ProgressionSidebarGroupProps = {
99
groupName: FormattedMessage;
10-
items: ComponentProps<typeof ProgressionSidebarItem>[];
10+
items: Array<ComponentProps<typeof ProgressionSidebarItem>>;
1111
};
1212

1313
const ProgressionSidebarGroup: FC<ProgressionSidebarGroupProps> = ({

0 commit comments

Comments
 (0)