Skip to content

Commit acb17e0

Browse files
authored
ci(docs): add linter check (#10376)
### Description Turning on the linter for the docs site now that we've done the bulk of our high velocity work. ### Testing Instructions CI. You can also browse the preview for anything that may look amiss.
1 parent 4c346b9 commit acb17e0

Some content is hidden

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

79 files changed

+348
-243
lines changed

docs/site/.eslintrc.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
/** @type {import('eslint').Linter.Config} */
22
module.exports = {
33
root: true,
4-
extends: ["@turbo/eslint-config/library", "next"],
4+
extends: ["@turbo/eslint-config/library", "plugin:@next/next/recommended"],
55
ignorePatterns: [
66
"turbo",
77
".map.ts",
88
"!app/.well-known/vercel/flags/route.ts",
99
".source",
10+
"components/ui/**",
11+
// TODO: Need to fix the JSON inference in this file
12+
"components/examples-table.tsx",
1013
],
1114
overrides: [
1215
{
@@ -16,7 +19,15 @@ module.exports = {
1619
},
1720
},
1821
{
19-
files: ["next.config.mjs", "global-error.jsx"],
22+
files: [
23+
"next.config.mjs",
24+
"global-error.tsx",
25+
"page.tsx",
26+
"not-found.tsx",
27+
"source.config.ts",
28+
"next.config.ts",
29+
"layout.tsx",
30+
],
2031
rules: {
2132
"import/no-default-export": "off",
2233
},

docs/site/app/(no-sidebar)/[...slug]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { notFound } from "next/navigation";
22
import { extraPages } from "@/app/source";
33

44
export default async function SlugLayout(props: {
5-
params: Promise<{ slug?: string[] }>;
5+
params: Promise<{ slug?: Array<string> }>;
66
children: React.ReactNode;
77
}): Promise<JSX.Element> {
88
const params = await props.params;

docs/site/app/(no-sidebar)/[...slug]/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createMetadata } from "@/lib/create-metadata";
55
import { mdxComponents } from "@/mdx-components";
66

77
export default async function Page(props: {
8-
params: Promise<{ slug?: string[] }>;
8+
params: Promise<{ slug?: Array<string> }>;
99
}): Promise<JSX.Element> {
1010
const params = await props.params;
1111
const page = extraPages.getPage(params.slug);
@@ -14,6 +14,7 @@ export default async function Page(props: {
1414
notFound();
1515
}
1616

17+
/* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- MDX component */
1718
const Mdx = page.data.body;
1819

1920
return (
@@ -24,14 +25,14 @@ export default async function Page(props: {
2425
);
2526
}
2627

27-
export function generateStaticParams(): { slug: string[] }[] {
28+
export function generateStaticParams(): Array<{ slug: Array<string> }> {
2829
return extraPages.getPages().map((page) => ({
2930
slug: page.slugs,
3031
}));
3132
}
3233

3334
export async function generateMetadata(props: {
34-
params: Promise<{ slug?: string[] }>;
35+
params: Promise<{ slug?: Array<string> }>;
3536
}): Promise<Metadata> {
3637
const params = await props.params;
3738
const page = extraPages.getPage(params.slug);

docs/site/app/(no-sidebar)/blog/[...slug]/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import { createMetadata } from "@/lib/create-metadata";
77
import { FaviconHandler } from "@/app/_components/favicon-handler";
88
import { mdxComponents } from "@/mdx-components";
99

10-
export function generateStaticParams(): { slug: string[] }[] {
10+
export function generateStaticParams(): Array<{ slug: Array<string> }> {
1111
return blog.getPages().map((page) => ({
1212
slug: page.slugs,
1313
}));
1414
}
1515

1616
export async function generateMetadata(props: {
17-
params: Promise<{ slug?: string[] }>;
17+
params: Promise<{ slug?: Array<string> }>;
1818
}): Promise<Metadata> {
1919
const params = await props.params;
2020
const page = blog.getPage(params.slug);
@@ -38,13 +38,14 @@ export async function generateMetadata(props: {
3838
}
3939

4040
export default async function Page(props: {
41-
params: Promise<{ slug?: string[] }>;
41+
params: Promise<{ slug?: Array<string> }>;
4242
}): Promise<JSX.Element> {
4343
const params = await props.params;
4444
const page = blog.getPage(params.slug);
4545

4646
if (!page) notFound();
4747

48+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Not being inferred correctly
4849
const Mdx = page.data.body;
4950

5051
return (

docs/site/app/(no-sidebar)/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function Layout({
1111
return (
1212
<>
1313
<FaviconHandler />
14-
{/* @ts-expect-error */}
14+
{/* @ts-expect-error - className isn't on type but it works. */}
1515
<HomeLayout className="p-0" {...baseOptions}>
1616
{children}
1717
</HomeLayout>

docs/site/app/(no-sidebar)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"use client";
22

33
import React, { useState } from "react";
4-
import { cn } from "@/components/cn";
54
import Link from "next/link";
65
import { motion } from "framer-motion";
6+
import { cn } from "@/components/cn";
77
import { Clients } from "@/app/_clients/clients";
88
import { FadeIn } from "@/app/_components/home-shared/fade-in";
99
import { PackLogo } from "@/app/_components/logos/pack-logo";

docs/site/app/(openapi)/docs/openapi/[[...slug]]/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ import {
77
import { notFound } from "next/navigation";
88
import defaultMdxComponents from "fumadocs-ui/mdx";
99
import { openapi, openapiPages } from "../source";
10-
// eslint-disable-next-line rulesdir/global-css
1110
import "./openapi.css";
1211

1312
export default async function Page(props: {
14-
params: Promise<{ slug?: string[] }>;
13+
params: Promise<{ slug?: Array<string> }>;
1514
}): Promise<JSX.Element> {
1615
const params = await props.params;
1716
const page = openapiPages.getPage(params.slug);
@@ -20,6 +19,7 @@ export default async function Page(props: {
2019
notFound();
2120
}
2221

22+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Not typed properly?
2323
const Mdx = page.data.body;
2424

2525
return (
@@ -30,6 +30,7 @@ export default async function Page(props: {
3030
<Mdx
3131
components={{
3232
...defaultMdxComponents,
33+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Not typed properly?
3334
APIPage: openapi.APIPage,
3435
}}
3536
/>
@@ -38,6 +39,6 @@ export default async function Page(props: {
3839
);
3940
}
4041

41-
export function generateStaticParams(): { slug: string[] }[] {
42+
export function generateStaticParams(): Array<{ slug: Array<string> }> {
4243
return openapiPages.generateParams();
4344
}

docs/site/app/(openapi)/docs/openapi/layout.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ import { Navigation } from "@/components/nav";
44
import { Sidebar } from "#/components/docs-layout/sidebar";
55
import { openapiPages } from "./source";
66

7-
export default async function Layout({
8-
children,
9-
}: {
10-
children: React.ReactNode;
11-
}) {
7+
export default function Layout({ children }: { children: React.ReactNode }) {
128
return (
139
<>
1410
<Navigation />
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { createMDXSource } from "fumadocs-mdx";
2-
import { createOpenAPI, attachFile } from "fumadocs-openapi/server";
2+
import { createOpenAPI } from "fumadocs-openapi/server";
33
import { loader } from "fumadocs-core/source";
44
import { openapiDocs, openapiMeta } from "@/.source";
55

66
export const openapiPages = loader({
77
baseUrl: "/docs/openapi",
88
source: createMDXSource(openapiDocs, openapiMeta),
9-
pageTree: {
10-
attachFile,
11-
},
129
});
1310

1411
export const openapi = createOpenAPI();

docs/site/app/(sidebar)/docs/[[...slug]]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { notFound } from "next/navigation";
33
import { repoDocsPages } from "@/app/source";
44

55
export default async function SlugLayout(props: {
6-
params: Promise<{ slug?: string[] }>;
6+
params: Promise<{ slug?: Array<string> }>;
77
children: React.ReactNode;
88
}): Promise<JSX.Element> {
99
const params = await props.params;

0 commit comments

Comments
 (0)