Skip to content

Commit a9aba1e

Browse files
committed
refactor(website): update component imports and restructure codebase
1 parent a61f4a7 commit a9aba1e

16 files changed

+157
-99
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,20 @@
107107
},
108108
"pnpm": {
109109
"overrides": {
110-
"array-flatten": "npm:@nolyfill/array-flatten@^1.0.42",
111-
"is-core-module": "npm:@nolyfill/is-core-module@^1.0.39",
112-
"isarray": "npm:@nolyfill/isarray@^1.0.29",
113-
"safe-buffer": "npm:@nolyfill/safe-buffer@^1.0.41",
114-
"safer-buffer": "npm:@nolyfill/safer-buffer@^1.0.41",
115-
"side-channel": "npm:@nolyfill/side-channel@^1.0.29",
116-
"typedarray": "npm:@nolyfill/typedarray@^1.0.29",
117110
"@types/react": "^19.0.2",
118111
"@types/react-dom": "^19.0.2",
112+
"array-flatten": "npm:@nolyfill/array-flatten@^1.0.42",
119113
"cross-spawn": "7.0.6",
114+
"is-core-module": "npm:@nolyfill/is-core-module@^1.0.39",
115+
"isarray": "npm:@nolyfill/isarray@^1.0.29",
120116
"next": "^15.1.2",
121117
"react": "^19.0.0",
122118
"react-dom": "^19.0.0",
119+
"safe-buffer": "npm:@nolyfill/safe-buffer@^1.0.41",
120+
"safer-buffer": "npm:@nolyfill/safer-buffer@^1.0.41",
121+
"side-channel": "npm:@nolyfill/side-channel@^1.0.29",
123122
"ts-api-utils": "^2.0.0",
123+
"typedarray": "npm:@nolyfill/typedarray@^1.0.29",
124124
"typescript": "^5.7.2"
125125
}
126126
}

pnpm-lock.yaml

Lines changed: 60 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/components/callout.tsx

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
21
import React from "react";
32

43
import logo from "#/assets/logo.svg";
54
import { Image } from "#/components/image";
65

7-
export function ESLintReactLogo() {
6+
export function Logo() {
87
return (
98
<div className="flex flex-col items-center gap-4 m-0 mx-auto p-8 w-fit">
109
<Image src={logo} alt="logo" width="150" height="150" />

website/eslint.config.mjs

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,53 @@
11
import js from "@eslint/js";
2+
import * as mdx from "eslint-plugin-mdx";
23
import tseslint from "typescript-eslint";
34
import next from "@next/eslint-plugin-next";
45
import react from "@eslint-react/eslint-plugin";
56
import reactHooks from "eslint-plugin-react-hooks";
67
import gitignore from "eslint-config-flat-gitignore";
8+
import simpleImportSort from "eslint-plugin-simple-import-sort";
9+
10+
const GLOB_TS = ["**/*.{ts,tsx}"];
11+
const GLOB_JS = ["**/*.{js,cjs,mjs}"];
12+
const GLOB_MDX = ["**/*.mdx"];
13+
const GLOB_APP = ["app/**/*.{js,ts,jsx,tsx}"];
714

815
export default tseslint.config(
916
js.configs.recommended,
10-
...tseslint.configs.recommendedTypeChecked,
17+
...tseslint.configs.recommended,
18+
{
19+
...mdx.flat,
20+
files: GLOB_MDX,
21+
processor: mdx.createRemarkProcessor({
22+
lintCodeBlocks: false,
23+
}),
24+
},
1125
{
26+
files: GLOB_TS,
1227
languageOptions: {
1328
parserOptions: {
1429
project: "./tsconfig.json",
1530
tsconfigRootDir: import.meta.dirname,
1631
},
1732
},
1833
rules: {
34+
...tseslint.configs.strictTypeCheckedOnly.rules,
1935
"no-undef": "off",
2036
},
2137
},
2238
{
23-
files: ["**/*.{ts,tsx}"],
39+
files: [...GLOB_TS, ...GLOB_MDX],
2440
...react.configs.recommended,
2541
},
2642
{
27-
files: ["**/*.{ts,tsx}"],
43+
files: GLOB_TS,
2844
plugins: {
2945
"react-hooks": reactHooks,
3046
},
3147
rules: reactHooks.configs.recommended.rules,
3248
},
3349
{
34-
files: ["**/*.{ts,tsx}"],
50+
files: GLOB_TS,
3551
plugins: {
3652
"@next/next": next,
3753
},
@@ -41,18 +57,29 @@ export default tseslint.config(
4157
},
4258
},
4359
{
44-
files: ["app/**/*.{js,ts,jsx,tsx}"],
60+
files: [...GLOB_TS, ...GLOB_MDX],
61+
plugins: {
62+
"simple-import-sort": simpleImportSort,
63+
},
64+
rules: {
65+
"simple-import-sort/exports": "warn",
66+
"simple-import-sort/imports": "warn",
67+
},
68+
},
69+
{
70+
files: GLOB_APP,
4571
rules: {
4672
"@typescript-eslint/require-await": "off",
4773
},
4874
},
4975
{
50-
files: ["*.js", "*.cjs"],
76+
files: [...GLOB_JS, ...GLOB_MDX],
5177
...tseslint.configs.disableTypeChecked,
5278
},
5379
{
54-
files: ["*.js", "*.cjs"],
80+
files: GLOB_JS,
5581
rules: {
82+
"no-undef": "off",
5683
"@typescript-eslint/no-require-imports": "off",
5784
},
5885
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { clsx, type ClassValue } from "clsx";
1+
import { type ClassValue, clsx } from "clsx";
22
import { twMerge } from "tailwind-merge";
33

44
export const cn = (...inputs: ReadonlyArray<ClassValue>) => twMerge(clsx(inputs));

website/next.config.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import nextra from "nextra";
2+
import remarkGFM from "remark-gfm";
23
// import codeImport from "remark-code-import";
3-
// import remarkGFM from "remark-gfm";
44

55
const withNextra = nextra({
66
theme: "nextra-theme-docs",
77
themeConfig: "./theme.config.tsx",
88
// defaultShowCopyCode: false,
9-
// mdxOptions: {
10-
// remarkPlugins: [
11-
// remarkGFM,
12-
// codeImport,
13-
// ],
14-
// },
9+
mdxOptions: {
10+
remarkPlugins: [
11+
remarkGFM,
12+
// codeImport,
13+
],
14+
},
1515
});
1616

1717
/** @type {import('next').NextConfig} */

website/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
"name": "@eslint-react/website",
33
"version": "1.0.0",
44
"scripts": {
5+
"prebuild": "rimraf .next",
56
"build": "next build",
67
"clean": "rm -rf .next node_modules/.cache",
8+
"predev": "rimraf .next",
79
"dev": "next dev",
810
"lint": "eslint .",
911
"start": "next start"
@@ -28,9 +30,9 @@
2830
"@types/node": "^22.10.2",
2931
"@types/react": "^19.0.2",
3032
"@types/react-dom": "^19.0.2",
31-
"@typescript-eslint/eslint-plugin": "^8.18.1",
3233
"@vitejs/plugin-react": "^4.3.4",
3334
"@workspace/configs": "workspace:*",
35+
"@workspace/eslint-plugins": "workspace:*",
3436
"autoprefixer": "^10.4.20",
3537
"clsx": "2.1.1",
3638
"effect": "^3.11.9",
@@ -42,6 +44,7 @@
4244
"remark-code-import": "^1.2.0",
4345
"remark-frontmatter": "^5.0.0",
4446
"remark-gfm": "^4.0.0",
47+
"rimraf": "^6.0.1",
4548
"sass": "^1.83.0",
4649
"tailwind-merge": "^2.5.5",
4750
"tailwindcss": "^3.4.17",

0 commit comments

Comments
 (0)