Skip to content

Commit b0badc9

Browse files
Nick the Sickclaude
andcommitted
chore: replace @ts-ignore with @ts-expect-error and fix formatting
Replace all @ts-ignore comments with @ts-expect-error for stricter type suppression across 6 files. Run Prettier to fix formatting drift. Nightshift-Task: lint-fix Nightshift-Ref: https://github.com/marcus/nightshift Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3ed8b53 commit b0badc9

File tree

210 files changed

+2316
-2291
lines changed

Some content is hidden

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

210 files changed

+2316
-2291
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ This diagram illustrates the release workflow for the BlockNote monorepo.
5555

5656
Essentially, when the maintainers have decided to release a new version of BlockNote, they will:
5757

58-
1. Check that the `main` branch is in a releasable state:
58+
1. Check that the `main` branch is in a releasable state:
5959
- CI status of main branch is green
6060
- Builds are passing
61-
2. Bump the package versions using the `pnpm run deploy` command. This command will:
61+
2. Bump the package versions using the `pnpm run deploy` command. This command will:
6262
1. Based on semantic versioning, determine the next version number.
6363
2. Apply the new version number to all publishable packages within the monorepo.
6464
3. Generate a changelog for the new version.
@@ -80,8 +80,8 @@ The release workflow will:
8080

8181
From time to time, you may need to publish a new package to npm. To do this, you cannot just deploy the package to npm, you need to:
8282

83-
1. Run `nx release version --dry-run` and check that the version number is correct for the package.
83+
1. Run `nx release version --dry-run` and check that the version number is correct for the package.
8484
- Once this is done, you can run `nx release version` to actually apply the version bump locally (staged to your local git repo).
85-
2. Run `nx release changelog --from <prev-version> <new-version> --dry-run` and check that the changelog is correct for the package.
85+
2. Run `nx release changelog --from <prev-version> <new-version> --dry-run` and check that the changelog is correct for the package.
8686
- Once this is done, you can run the same command without the `--dry-run` flag to actually apply the changelog, commit & push the changes to the `main` branch.
87-
3. The release workflow will automatically publish the package to npm.
87+
3. The release workflow will automatically publish the package to npm.

docs/components/FadeIn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function FadeIn({
3535
return (
3636
<motion.div
3737
animate={inView ? "animate" : "initial"}
38-
// @ts-ignore ignore type error
38+
// @ts-expect-error ignore type error
3939
className={className}
4040
initial={false}
4141
ref={ref}
Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
'use client';
2-
import type { ComponentProps } from 'react';
3-
import { useI18n } from '@fumadocs/base-ui/contexts/i18n';
4-
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
5-
import { cn } from '../../../lib/fumadocs/cn';
6-
import { buttonVariants } from '../ui/button';
1+
"use client";
2+
import type { ComponentProps } from "react";
3+
import { useI18n } from "@fumadocs/base-ui/contexts/i18n";
4+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
5+
import { cn } from "../../../lib/fumadocs/cn";
6+
import { buttonVariants } from "../ui/button";
77

8-
export type LanguageSelectProps = ComponentProps<'button'>;
8+
export type LanguageSelectProps = ComponentProps<"button">;
99

1010
export function LanguageToggle(props: LanguageSelectProps): React.ReactElement {
1111
const context = useI18n();
12-
if (!context.locales) throw new Error('Missing `<I18nProvider />`');
12+
if (!context.locales) throw new Error("Missing `<I18nProvider />`");
1313

1414
return (
1515
<Popover>
@@ -18,27 +18,27 @@ export function LanguageToggle(props: LanguageSelectProps): React.ReactElement {
1818
{...props}
1919
className={cn(
2020
buttonVariants({
21-
color: 'ghost',
22-
className: 'gap-1.5 p-1.5',
21+
color: "ghost",
22+
className: "gap-1.5 p-1.5",
2323
}),
2424
props.className,
2525
)}
2626
>
2727
{props.children}
2828
</PopoverTrigger>
2929
<PopoverContent className="flex flex-col overflow-x-hidden p-0">
30-
<p className="mb-1 p-2 text-xs font-medium text-fd-muted-foreground">
30+
<p className="text-fd-muted-foreground mb-1 p-2 text-xs font-medium">
3131
{context.text.chooseLanguage}
3232
</p>
3333
{context.locales.map((item) => (
3434
<button
3535
key={item.locale}
3636
type="button"
3737
className={cn(
38-
'p-2 text-start text-sm',
38+
"p-2 text-start text-sm",
3939
item.locale === context.locale
40-
? 'bg-fd-primary/10 font-medium text-fd-primary'
41-
: 'hover:bg-fd-accent hover:text-fd-accent-foreground',
40+
? "bg-fd-primary/10 text-fd-primary font-medium"
41+
: "hover:bg-fd-accent hover:text-fd-accent-foreground",
4242
)}
4343
onClick={() => {
4444
context.onChange?.(item.locale);
@@ -52,9 +52,11 @@ export function LanguageToggle(props: LanguageSelectProps): React.ReactElement {
5252
);
5353
}
5454

55-
export function LanguageToggleText(props: ComponentProps<'span'>) {
55+
export function LanguageToggleText(props: ComponentProps<"span">) {
5656
const context = useI18n();
57-
const text = context.locales?.find((item) => item.locale === context.locale)?.name;
57+
const text = context.locales?.find(
58+
(item) => item.locale === context.locale,
59+
)?.name;
5860

5961
return <span {...props}>{text}</span>;
6062
}

docs/components/fumadocs/layout/link-item.tsx

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
'use client';
2-
import type { ComponentProps, ReactNode } from 'react';
3-
import { usePathname } from 'fumadocs-core/framework';
4-
import { isActive } from '../../../lib/fumadocs/urls';
5-
import Link from 'fumadocs-core/link';
1+
"use client";
2+
import type { ComponentProps, ReactNode } from "react";
3+
import { usePathname } from "fumadocs-core/framework";
4+
import { isActive } from "../../../lib/fumadocs/urls";
5+
import Link from "fumadocs-core/link";
66

77
interface Filterable {
88
/**
99
* Restrict where the item is displayed
1010
*
1111
* @defaultValue 'all'
1212
*/
13-
on?: 'menu' | 'nav' | 'all';
13+
on?: "menu" | "nav" | "all";
1414
}
1515

1616
interface WithHref {
@@ -20,20 +20,20 @@ interface WithHref {
2020
*
2121
* @defaultValue 'url'
2222
*/
23-
active?: 'url' | 'nested-url' | 'none';
23+
active?: "url" | "nested-url" | "none";
2424
external?: boolean;
2525
}
2626

2727
export interface MainItemType extends WithHref, Filterable {
28-
type?: 'main';
28+
type?: "main";
2929
icon?: ReactNode;
3030
text: ReactNode;
3131
description?: ReactNode;
3232
groupName?: string; // added to group into columns
3333
}
3434

3535
export interface IconItemType extends WithHref, Filterable {
36-
type: 'icon';
36+
type: "icon";
3737
/**
3838
* `aria-label` of icon button
3939
*/
@@ -47,7 +47,7 @@ export interface IconItemType extends WithHref, Filterable {
4747
}
4848

4949
export interface ButtonItemType extends WithHref, Filterable {
50-
type: 'button';
50+
type: "button";
5151
icon?: ReactNode;
5252
text: ReactNode;
5353
/**
@@ -57,7 +57,7 @@ export interface ButtonItemType extends WithHref, Filterable {
5757
}
5858

5959
export interface MenuItemType extends Partial<WithHref>, Filterable {
60-
type: 'menu';
60+
type: "menu";
6161
icon?: ReactNode;
6262
text: ReactNode;
6363

@@ -66,7 +66,7 @@ export interface MenuItemType extends Partial<WithHref>, Filterable {
6666
/**
6767
* Options when displayed on navigation menu
6868
*/
69-
menu?: ComponentProps<'a'> & {
69+
menu?: ComponentProps<"a"> & {
7070
banner?: ReactNode;
7171
};
7272
})
@@ -80,7 +80,7 @@ export interface MenuItemType extends Partial<WithHref>, Filterable {
8080
}
8181

8282
export interface CustomItemType extends Filterable {
83-
type: 'custom';
83+
type: "custom";
8484
/**
8585
* @defaultValue false
8686
*/
@@ -99,13 +99,21 @@ export function LinkItem({
9999
ref,
100100
item,
101101
...props
102-
}: Omit<ComponentProps<'a'>, 'href'> & { item: WithHref }) {
102+
}: Omit<ComponentProps<"a">, "href"> & { item: WithHref }) {
103103
const pathname = usePathname();
104-
const activeType = item.active ?? 'url';
105-
const active = activeType !== 'none' && isActive(item.url, pathname, activeType === 'nested-url');
104+
const activeType = item.active ?? "url";
105+
const active =
106+
activeType !== "none" &&
107+
isActive(item.url, pathname, activeType === "nested-url");
106108

107109
return (
108-
<Link ref={ref} href={item.url} external={item.external} {...props} data-active={active}>
110+
<Link
111+
ref={ref}
112+
href={item.url}
113+
external={item.external}
114+
{...props}
115+
data-active={active}
116+
>
109117
{props.children}
110118
</Link>
111119
);

docs/components/fumadocs/layout/search-toggle.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
'use client';
2-
import type { ComponentProps } from 'react';
3-
import { Search } from 'lucide-react';
4-
import { useSearchContext } from '@fumadocs/base-ui/contexts/search';
5-
import { useI18n } from '@fumadocs/base-ui/contexts/i18n';
6-
import { cn } from '../../../lib/fumadocs/cn';
7-
import { type ButtonProps, buttonVariants } from '../ui/button';
1+
"use client";
2+
import type { ComponentProps } from "react";
3+
import { Search } from "lucide-react";
4+
import { useSearchContext } from "@fumadocs/base-ui/contexts/search";
5+
import { useI18n } from "@fumadocs/base-ui/contexts/i18n";
6+
import { cn } from "../../../lib/fumadocs/cn";
7+
import { type ButtonProps, buttonVariants } from "../ui/button";
88

9-
interface SearchToggleProps extends Omit<ComponentProps<'button'>, 'color'>, ButtonProps {
9+
interface SearchToggleProps
10+
extends Omit<ComponentProps<"button">, "color">,
11+
ButtonProps {
1012
hideIfDisabled?: boolean;
1113
}
1214

1315
export function SearchToggle({
1416
hideIfDisabled,
15-
size = 'icon-sm',
16-
color = 'ghost',
17+
size = "icon-sm",
18+
color = "ghost",
1719
...props
1820
}: SearchToggleProps) {
1921
const { setOpenSearch, enabled } = useSearchContext();
@@ -43,7 +45,7 @@ export function SearchToggle({
4345
export function LargeSearchToggle({
4446
hideIfDisabled,
4547
...props
46-
}: ComponentProps<'button'> & {
48+
}: ComponentProps<"button"> & {
4749
hideIfDisabled?: boolean;
4850
}) {
4951
const { enabled, hotKey, setOpenSearch } = useSearchContext();
@@ -56,7 +58,7 @@ export function LargeSearchToggle({
5658
data-search-full=""
5759
{...props}
5860
className={cn(
59-
'inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground',
61+
"bg-fd-secondary/50 text-fd-muted-foreground hover:bg-fd-accent hover:text-fd-accent-foreground inline-flex items-center gap-2 rounded-lg border p-1.5 ps-2 text-sm transition-colors",
6062
props.className,
6163
)}
6264
onClick={() => {
@@ -67,7 +69,7 @@ export function LargeSearchToggle({
6769
{text.search}
6870
<div className="ms-auto inline-flex gap-0.5">
6971
{hotKey.map((k, i) => (
70-
<kbd key={i} className="rounded-md border bg-fd-background px-1.5">
72+
<kbd key={i} className="bg-fd-background rounded-md border px-1.5">
7173
{k.display}
7274
</kbd>
7375
))}

docs/components/fumadocs/layout/shared.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import type { ComponentProps, ReactNode } from 'react';
2-
import type { I18nConfig } from 'fumadocs-core/i18n';
3-
import type { LinkItemType } from './link-item';
4-
import Link from 'fumadocs-core/link';
1+
import type { ComponentProps, ReactNode } from "react";
2+
import type { I18nConfig } from "fumadocs-core/i18n";
3+
import type { LinkItemType } from "./link-item";
4+
import Link from "fumadocs-core/link";
55

66
export interface NavOptions {
77
enabled: boolean;
88
component: ReactNode;
99

10-
title?: ReactNode | ((props: ComponentProps<'a'>) => ReactNode);
10+
title?: ReactNode | ((props: ComponentProps<"a">) => ReactNode);
1111

1212
/**
1313
* Redirect url of title
@@ -20,7 +20,7 @@ export interface NavOptions {
2020
*
2121
* @defaultValue none
2222
*/
23-
transparentMode?: 'always' | 'top' | 'none';
23+
transparentMode?: "always" | "top" | "none";
2424

2525
children?: ReactNode;
2626
}
@@ -29,7 +29,7 @@ export interface BaseLayoutProps {
2929
themeSwitch?: {
3030
enabled?: boolean;
3131
component?: ReactNode;
32-
mode?: 'light-dark' | 'light-dark-system';
32+
mode?: "light-dark" | "light-dark-system";
3333
};
3434

3535
searchToggle?: Partial<{
@@ -67,15 +67,15 @@ export interface BaseLayoutProps {
6767
export function resolveLinkItems({
6868
links = [],
6969
githubUrl,
70-
}: Pick<BaseLayoutProps, 'links' | 'githubUrl'>): LinkItemType[] {
70+
}: Pick<BaseLayoutProps, "links" | "githubUrl">): LinkItemType[] {
7171
const result = [...links];
7272

7373
if (githubUrl)
7474
result.push({
75-
type: 'icon',
75+
type: "icon",
7676
url: githubUrl,
77-
text: 'Github',
78-
label: 'GitHub',
77+
text: "Github",
78+
label: "GitHub",
7979
icon: (
8080
<svg role="img" viewBox="0 0 24 24" fill="currentColor">
8181
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
@@ -88,15 +88,15 @@ export function resolveLinkItems({
8888
}
8989

9090
export function renderTitleNav(
91-
{ title, url = '/' }: Partial<NavOptions>,
92-
props: ComponentProps<'a'>,
91+
{ title, url = "/" }: Partial<NavOptions>,
92+
props: ComponentProps<"a">,
9393
) {
94-
if (typeof title === 'function') return title({ href: url, ...props });
94+
if (typeof title === "function") return title({ href: url, ...props });
9595
return (
9696
<Link href={url} {...props}>
9797
{title}
9898
</Link>
9999
);
100100
}
101101

102-
export type * from './link-item';
102+
export type * from "./link-item";

0 commit comments

Comments
 (0)