Skip to content

Commit

Permalink
refactor(website): switch from nextra to fumadocs (#928)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rel1cx authored Jan 25, 2025
1 parent 41ee491 commit 9d15f81
Show file tree
Hide file tree
Showing 162 changed files with 4,673 additions and 4,036 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ env:
NODE_OPTIONS: --max_old_space_size=10240
jobs:
check:
runs-on: ubuntu-24.04-arm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Workaround for GitHub Actions bug
- name: Enable Corepack
run: corepack enable
- name: Setup node@22
uses: actions/setup-node@v4
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ on:
jobs:
publish:
name: Publish
runs-on: ubuntu-24.04-arm
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
# Workaround for GitHub Actions bug
- name: Enable Corepack
run: corepack enable
- name: Setup node@20
uses: actions/setup-node@v4
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ env:
NODE_OPTIONS: --max_old_space_size=102400
jobs:
test:
runs-on: ubuntu-24.04-arm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Workaround for GitHub Actions bug
- name: Enable Corepack
run: corepack enable
- name: Setup node@22
uses: actions/setup-node@v4
with:
Expand Down
1 change: 0 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"metas",
"monaspace",
"neovov",
"nextra",
"nocheck",
"noninteractive",
"noto",
Expand Down
3 changes: 1 addition & 2 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,14 @@ const enableTypeCheckedRules = {
allowNumber: true,
allowString: false,
}],
} as const;
} satisfies typeof tseslint.configs.disableTypeChecked.rules;

const disableTypeCheckedRules = Object.fromEntries(Object.keys(enableTypeCheckedRules).map((x) => [x, "off"]));

export default tseslint.config(
eslintConfigFlatGitignore(),
{
extends: [
// @ts-expect-error - TODO: make types compatible
eslintMarkdown.configs.recommended,
],
files: GLOB_MD,
Expand Down
8 changes: 4 additions & 4 deletions examples/dual-react-dom-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
},
"devDependencies": {
"@eslint-react/eslint-plugin": "^1.24.1",
"@eslint/js": "^9.18.0",
"@eslint/js": "^9.19.0",
"@tsconfig/node22": "^22.0.0",
"@tsconfig/strictest": "^2.0.5",
"@types/node": "^22.10.7",
"@types/react": "^19.0.7",
"eslint": "^9.18.0",
"@types/node": "^22.10.10",
"@types/react": "^19.0.8",
"eslint": "^9.19.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-vitest": "^0.5.4",
"react": "^19.0.0",
Expand Down
10 changes: 5 additions & 5 deletions examples/next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"devDependencies": {
"@eslint-react/eslint-plugin": "^1.24.1",
"@eslint/config-inspector": "^1.0.0",
"@eslint/js": "^9.18.0",
"@next/eslint-plugin-next": "^15.1.5",
"@eslint/js": "^9.19.0",
"@next/eslint-plugin-next": "^15.1.6",
"@types/negotiator": "^0.6.3",
"@types/node": "^22.10.7",
"@types/react": "^19.0.7",
"@types/node": "^22.10.10",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"autoprefixer": "10.4.20",
"eslint": "^9.18.0",
"eslint": "^9.19.0",
"eslint-config-flat-gitignore": "^1.0.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.18",
Expand Down
6 changes: 3 additions & 3 deletions examples/vite-react-dom-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"devDependencies": {
"@eslint-react/eslint-plugin": "^1.24.1",
"@eslint/config-inspector": "^1.0.0",
"@eslint/js": "^9.18.0",
"@eslint/js": "^9.19.0",
"@tsconfig/node22": "^22.0.0",
"@tsconfig/strictest": "^2.0.5",
"@types/react": "^19.0.7",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.18.0",
"eslint": "^9.19.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.18",
"typescript": "^5.7.3",
Expand Down
6 changes: 3 additions & 3 deletions examples/vite-react-dom-js-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"devDependencies": {
"@eslint-react/eslint-plugin": "^1.24.1",
"@eslint/config-inspector": "^1.0.0",
"@eslint/js": "^9.18.0",
"@types/react": "^19.0.7",
"@eslint/js": "^9.19.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.18.0",
"eslint": "^9.19.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.18",
"globals": "^15.14.0",
Expand Down
10 changes: 5 additions & 5 deletions examples/vite-react-dom-js-with-babel-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
"react-dom": "^19.0.0"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/core": "^7.26.7",
"@babel/eslint-parser": "^7.26.5",
"@babel/preset-env": "^7.26.0",
"@babel/preset-env": "^7.26.7",
"@babel/preset-react": "^7.26.3",
"@eslint-react/eslint-plugin": "^1.24.1",
"@eslint/config-inspector": "^1.0.0",
"@eslint/js": "^9.18.0",
"@eslint/js": "^9.19.0",
"@types/babel__core": "~7.20.5",
"@types/babel__preset-env": "~7.9.7",
"@types/react": "^19.0.7",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.18.0",
"eslint": "^9.19.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.18",
"globals": "^15.14.0",
Expand Down
22 changes: 22 additions & 0 deletions examples/vite-react-dom-with-ts-blank-eslint-parser-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "@eslint/js";
declare module "eslint-plugin-react-hooks";
declare module "eslint-plugin-react-refresh";
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// @ts-check
import eslintJs from "@eslint/js";
import eslintReact from "@eslint-react/eslint-plugin";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import eslintPluginReactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import tsBlankEslintParser from "ts-blank-eslint-parser";

import TSCONFIG from "./tsconfig.json" with { type: "json" };
import TSCONFIG_NODE from "./tsconfig.node.json" with { type: "json" };

const GLOB_TS = ["**/*.ts", "**/*.tsx"];

export default [
// base configuration for browser environment source files
{
files: TSCONFIG.include,
languageOptions: {
globals: {
...globals.browser,
},
parser: tsBlankEslintParser,
parserOptions: {
jsxPragma: "React",
sourceType: "module",
},
},
rules: {
...eslintJs.configs.recommended.rules,
},
},
// base configuration for node environment source files (*.config.js, etc.)
{
files: TSCONFIG_NODE.include,
ignores: TSCONFIG_NODE.exclude,
languageOptions: {
globals: {
...globals.node,
},
parser: tsBlankEslintParser,
parserOptions: {
sourceType: "module",
},
},
rules: {
...eslintJs.configs.recommended.rules,
"no-console": "off",
},
},
// React configuration
{
files: TSCONFIG.include,
...eslintReact.configs.recommended,
},
// React Hooks configuration
{
files: TSCONFIG.include,
plugins: {
"react-hooks": eslintPluginReactHooks,
},
rules: eslintPluginReactHooks.configs.recommended.rules,
},
// React Refresh configuration
{
files: TSCONFIG.include,
plugins: {
"react-refresh": eslintPluginReactRefresh,
},
rules: {
"react-refresh/only-export-components": "warn",
},
},
];
15 changes: 15 additions & 0 deletions examples/vite-react-dom-with-ts-blank-eslint-parser-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>eslint-react-example</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.ts"></script>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@examples/vite-react-dom-with-ts-blank-eslint-parser-app",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "tsc && vite build",
"dev": "vite",
"inspect:eslint-config": "eslint-config-inspector",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@eslint-react/eslint-plugin": "^1.24.1",
"@eslint/config-inspector": "^1.0.0",
"@eslint/js": "^9.19.0",
"@tsconfig/node22": "^22.0.0",
"@tsconfig/strictest": "^2.0.5",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.19.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.18",
"globals": "^15.14.0",
"ts-blank-eslint-parser": "0.0.3",
"typescript": "^5.7.3",
"vite": "^6.0.11"
},
"engines": {
"node": ">=18.18.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 8em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}

.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}

.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}

to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a>.logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import "./App.css";

import { useState } from "react";

import logo from "./assets/eslint-react.svg";

function App() {
const [count, setCount] = useState(0n);

return (
<div>
<div>
<a href="https://eslint-react.xyz" target="_blank" rel="noopener noreferrer">
<img alt="logo" className="logo" src={logo} />
</a>
</div>
<div className="card">
<button type="button" onClick={() => setCount((count) => count + 1n)}>
count is {count.toString()}
</button>
</div>
</div>
);
}

export default App;
Loading

0 comments on commit 9d15f81

Please sign in to comment.