Skip to content

Commit 94d033f

Browse files
committed
fix(website): use static CodeBlock component in type tables
1 parent fb9159c commit 94d033f

File tree

17 files changed

+42
-18
lines changed

17 files changed

+42
-18
lines changed

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.32.0-next.0
1+
1.32.0-beta.0
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { highlight } from "fumadocs-core/highlight";
2+
import * as Base from "fumadocs-ui/components/codeblock";
3+
4+
export interface CodeBlockProps {
5+
code: string;
6+
lang: string;
7+
wrapper?: Base.CodeBlockProps;
8+
}
9+
10+
export async function CodeBlock({ code, lang, wrapper }: CodeBlockProps) {
11+
const rendered = await highlight(code, {
12+
components: {
13+
pre: Base.Pre,
14+
},
15+
lang,
16+
themes: {
17+
dark: "vesper",
18+
light: "github-light",
19+
},
20+
});
21+
22+
return <Base.CodeBlock {...wrapper}>{rendered}</Base.CodeBlock>;
23+
}

apps/website/content/docs/configurations.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* eslint-disable perfectionist/sort-objects */
22
import dedent from "dedent";
3-
import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";
43
import { TypeTable } from "fumadocs-ui/components/type-table";
54
import { Link } from "next-view-transitions";
65

6+
import { CodeBlock } from "#/components/code-block";
7+
78
export function SettingsTypeTable() {
89
return (
910
<TypeTable
@@ -39,7 +40,7 @@ export function SettingsTypeTable() {
3940
description: <Link href="#additionalcomponents">An array of components and its attributes mapping ⤵</Link>,
4041
default: "[]",
4142
typeDescription: (
42-
<DynamicCodeBlock
43+
<CodeBlock
4344
code={dedent`
4445
type CustomComponent = {
4546
name: string;
@@ -60,7 +61,7 @@ export function SettingsTypeTable() {
6061
description: <Link href="#additionalhooks">An object of aliases for React built-in Hooks ⤵</Link>,
6162
default: "{}",
6263
typeDescription: (
63-
<DynamicCodeBlock
64+
<CodeBlock
6465
code={dedent`
6566
type ReactBuiltInHookName =
6667
| "use"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/monorepo",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"private": true,
55
"description": "Monorepo for eslint-plugin-react-[x, dom, web-api, hooks-extra, naming-convention].",
66
"keywords": [

packages/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/core",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and Patterns.",
55
"homepage": "https://github.com/Rel1cx/eslint-react",
66
"bugs": {

packages/plugins/eslint-plugin-react-debug/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-debug",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's ESLint plugin for debugging related rules.",
55
"keywords": [
66
"react",

packages/plugins/eslint-plugin-react-dom/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-dom",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's ESLint plugin for React DOM related rules.",
55
"keywords": [
66
"react",

packages/plugins/eslint-plugin-react-hooks-extra/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-hooks-extra",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
55
"keywords": [
66
"react",

packages/plugins/eslint-plugin-react-naming-convention/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-naming-convention",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's ESLint plugin for naming convention related rules.",
55
"keywords": [
66
"react",

packages/plugins/eslint-plugin-react-web-api/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-web-api",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
55
"keywords": [
66
"react",

packages/plugins/eslint-plugin-react-x/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-react-x",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "A set of composable linting rules for libraries and frameworks that use React as a UI runtime.",
55
"keywords": [
66
"react",

packages/plugins/eslint-plugin/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/eslint-plugin",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "More than 80 high-quality linting rules for writing better React code.",
55
"keywords": [
66
"react",

packages/shared/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/shared",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's Shared constants and functions.",
55
"homepage": "https://github.com/Rel1cx/eslint-react",
66
"bugs": {

packages/utilities/ast/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/ast",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's TSESTree AST utility module.",
55
"homepage": "https://github.com/Rel1cx/eslint-react",
66
"bugs": {

packages/utilities/eff/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/eff",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "JavaScript and TypeScript utilities (previously some re-exports of the effect library).",
55
"homepage": "https://github.com/Rel1cx/eslint-react",
66
"bugs": {

packages/utilities/jsx/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/jsx",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's TSESTree AST utility module for static analysis of JSX.",
55
"homepage": "https://github.com/Rel1cx/eslint-react",
66
"bugs": {

packages/utilities/var/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/var",
3-
"version": "1.32.0-next.0",
3+
"version": "1.32.0-beta.0",
44
"description": "ESLint React's TSESTree AST utility module for static analysis of variables.",
55
"homepage": "https://github.com/Rel1cx/eslint-react",
66
"bugs": {

0 commit comments

Comments
 (0)