Skip to content

repo: update biome.json to lint website #2807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
"files": {
"ignoreUnknown": false,
"includes": [
"*.md",
"*.ts",
"*.tsx",
"*.js",
"src/**/*.ts",
"src/**/*.tsx",
"examples/**/*.ts",
"examples/**/*.tsx"
"examples/**/*.tsx",
"website/*.ts",
"website/src/**/*.ts",
"website/src/**/*.tsx",
"examples-app/src/**/*.ts",
"examples-app/src/**/*.tsx"
]
},
"formatter": {
Expand Down
1 change: 1 addition & 0 deletions examples-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function App() {
}
}, []);

// biome-ignore lint: suspicious/noDynamicNamespaceImportAccess: not a concern
const Component: React.ComponentType = Examples[
example as keyof typeof Examples
] as React.ComponentType;
Expand Down
4 changes: 2 additions & 2 deletions examples-app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";

ReactDOM.createRoot(document.getElementById("root")!).render(
ReactDOM.createRoot(document.getElementById("root") ?? document.body).render(
<React.StrictMode>
<App />
</React.StrictMode>
</React.StrictMode>,
);
23 changes: 4 additions & 19 deletions react-day-picker.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,16 @@
],
"settings": {
"cSpell.enabled": true,
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit",
"source.fixAll.biome": "explicit"
},
"editor.tabSize": 2,
"npm.packageManager": "pnpm",
"search.exclude": {
"node_modules": true,
"versioned_docs": true
},
"jest.runMode": "on-demand",
"workbench.colorCustomizations": {
"activityBar.background": "#005994",
"activityBar.foreground": "#d8d8d8",
"activityBar.inactiveForeground": "#d8d8d877",
"activityBarBadge.background": "#dd006f",
"activityBarBadge.foreground": "#e7e7e7"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
}
82 changes: 41 additions & 41 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const config: Config = {

i18n: {
defaultLocale: "en",
locales: ["en"]
locales: ["en"],
},

presets: [
Expand All @@ -33,25 +33,25 @@ const config: Config = {
editUrl: "https://github.com/gpbl/react-day-picker/tree/main/website",
remarkPlugins: [
require("@docusaurus/remark-plugin-npm2yarn"),
[require("remark-github"), { repository: "gpbl/react-day-picker" }]
[require("remark-github"), { repository: "gpbl/react-day-picker" }],
],
lastVersion: "current",
versions: {
"8.10.1": {
label: "8.10.1",
badge: true,
path: "/v8"
path: "/v8",
},
current: {
label: `${pkg.version}`,
path: "/",
badge: false
}
}
badge: false,
},
},
},
blog: false,
theme: {
customCss: ["./src/css/custom.css", "../src/style.css"]
customCss: ["./src/css/custom.css", "../src/style.css"],
},
sitemap: {
lastmod: "date",
Expand All @@ -63,40 +63,40 @@ const config: Config = {
const { defaultCreateSitemapItems, ...rest } = params;
const items = await defaultCreateSitemapItems(rest);
return items.filter((item) => !item.url.includes("/page/"));
}
}
} satisfies Preset.Options
]
},
},
} satisfies Preset.Options,
],
],

plugins: [
[
"docusaurus-plugin-typedoc",
{
entryPoints: ["../src/index.ts"],
tsconfig: "../tsconfig-docs.json"
}
tsconfig: "../tsconfig-docs.json",
},
],
[
"@docusaurus/plugin-client-redirects",
{
redirects: [
{
to: "/guides/accessibility",
from: ["/docs/accessibility"]
}
]
}
]
from: ["/docs/accessibility"],
},
],
},
],
],

scripts: [
{
src: "/q/p/script.js",
defer: true,
"data-domain": "daypicker.dev",
"data-api": "/q/a/event"
}
"data-api": "/q/a/event",
},
],

themeConfig: {
Expand All @@ -105,25 +105,25 @@ const config: Config = {
{
name: "og:description",
content:
"Date picker component for React. Add date pickers, calendars, and date inputs to your web applications."
"Date picker component for React. Add date pickers, calendars, and date inputs to your web applications.",
},
{
name: "description",
content:
"Date picker component for React. Add date pickers, calendars, and date inputs to your web applications."
"Date picker component for React. Add date pickers, calendars, and date inputs to your web applications.",
},
{
name: "keywords",
content:
"date picker, react component, calendar component, react datepicker, daypicker, react day picker, date-fns date picker, typescript date picker"
}
"date picker, react component, calendar component, react datepicker, daypicker, react day picker, date-fns date picker, typescript date picker",
},
],
navbar: {
title: "React DayPicker",
logo: {
alt: "DayPicker Logo",
src: "img/logo.png",
srcDark: "img/logo-dark.png"
srcDark: "img/logo-dark.png",
},
items: [
{
Expand All @@ -134,62 +134,62 @@ const config: Config = {
dropdownItemsAfter: [
{
href: "https://react-day-picker-v7.netlify.app",
label: "7.4.10"
}
]
label: "7.4.10",
},
],
},
{
type: "docSidebar",
sidebarId: "docs",
position: "left",
label: "Documentation"
label: "Documentation",
},
{
href: "/playground",
label: "Playground",
position: "left"
position: "left",
},
{
type: "docSidebar",
sidebarId: "api",
position: "left",
label: "API Reference"
label: "API Reference",
},

{
href: "https://github.com/gpbl/react-day-picker/discussions",
label: "Support",
position: "right"
position: "right",
},
{
href: "https://github.com/gpbl/react-day-picker",
label: "GitHub",
position: "right"
}
]
position: "right",
},
],
},
footer: undefined,
prism: {
additionalLanguages: ["bash", "diff", "json", "css"],
theme: prismThemes.vsLight,
darkTheme: prismThemes.dracula
darkTheme: prismThemes.dracula,
},
algolia: {
appId: "N44150BS2A",
apiKey: "263c558c76fc0b83a5def5fb818391d7",
indexName: "react-day-picker-js",
contextualSearch: true,
searchPagePath: "search"
searchPagePath: "search",
},
colorMode: {
defaultMode: "light",
respectPrefersColorScheme: true
}
respectPrefersColorScheme: true,
},
},
future: {
v4: true,
experimental_faster: true
} satisfies Preset.ThemeConfig
experimental_faster: true,
} satisfies Preset.ThemeConfig,
};

export default config;
26 changes: 13 additions & 13 deletions website/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const typedocSidebarFixed = typedocSidebar.map((item) => {
return {
type: "doc",
id: "api/classes/DateLib",
label: "DateLib"
label: "DateLib",
};
}
return item;
})
}),
};
}
return item;
Expand All @@ -36,9 +36,9 @@ const sidebars: SidebarsConfig = {
items: [
{
type: "autogenerated",
dirName: "docs"
}
]
dirName: "docs",
},
],
},
{
type: "category",
Expand All @@ -47,9 +47,9 @@ const sidebars: SidebarsConfig = {
items: [
{
type: "autogenerated",
dirName: "guides"
}
]
dirName: "guides",
},
],
},
{
type: "category",
Expand All @@ -58,12 +58,12 @@ const sidebars: SidebarsConfig = {
items: [
{
type: "autogenerated",
dirName: "development"
}
]
}
dirName: "development",
},
],
},
],
api: ["api/index", typedocSidebarFixed]
api: ["api/index", typedocSidebarFixed],
};

export default sidebars;
2 changes: 1 addition & 1 deletion website/src/components/BrowserWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function BrowserWindow({
style,
bodyStyle,
shadow = true,
styleStr
styleStr,
}: Props) {
return (
<div className={styles.browserWindow} style={{ ...style, minHeight }}>
Expand Down
11 changes: 3 additions & 8 deletions website/src/components/HighlightWithTheme.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";

/** biome-ignore-all lint/suspicious/noArrayIndexKey: not a concern */
import { usePrismTheme } from "@docusaurus/theme-common";
import { Highlight, HighlightProps } from "prism-react-renderer";
import { Highlight, type HighlightProps } from "prism-react-renderer";

export function HighlightWithTheme(props: Partial<HighlightProps>) {
const prismTheme = usePrismTheme();
Expand All @@ -13,11 +12,7 @@ export function HighlightWithTheme(props: Partial<HighlightProps>) {
return (
<div key={i}>
{line.map((token, key) => {
return (
<>
<span key={key} {...getTokenProps({ token })} />
</>
);
return <span key={key} {...getTokenProps({ token })} />;
})}
</div>
);
Expand Down
Loading