Skip to content

Commit 5c20ed5

Browse files
committed
refactor(website): minor improvements
1 parent 0ca3767 commit 5c20ed5

File tree

9 files changed

+179
-136
lines changed

9 files changed

+179
-136
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
*.md
2+
*.mdx
23
!overview.md
4+
!overview.mdx

apps/website/content/docs/rules/overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ title: Overview
33
full: true
44
---
55

6-
<Callout type="info">
7-
TIP:
6+
<Callout type="info" title="TIP">
87

98
Linter rules can have false positives, false negatives, and some rules are dependent on the `react` or `react-dom` [version](https://react.dev/versions) you are using.
9+
1010
</Callout>
1111

1212
- 🌟 - Feature

apps/website/migration/index.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/* eslint-disable perfectionist/sort-objects */
2+
export const redirects = [
3+
// Redirects for old documentation links
4+
{
5+
source: "/docs/getting-started/javascript-with-alternative-parser",
6+
destination: "/docs/using-an-alternative-parser/babel-eslint-parser",
7+
permanent: true,
8+
},
9+
{
10+
source: "/docs/getting-started/typescript-with-alternative-parser",
11+
destination: "/docs/using-an-alternative-parser/ts-blank-eslint-parser",
12+
permanent: true,
13+
},
14+
// Redirects for old rule names
15+
{
16+
source: "/docs/rules/use-jsx-vars",
17+
destination: "/docs/rules/jsx-uses-vars",
18+
permanent: true,
19+
},
20+
{
21+
source: "/docs/rules/no-duplicate-jsx-props",
22+
destination: "/docs/rules/jsx-no-duplicate-props",
23+
permanent: true,
24+
},
25+
{
26+
source: "/docs/rules/no-complicated-conditional-rendering",
27+
destination: "/docs/rules/no-complex-conditional-rendering",
28+
permanent: true,
29+
},
30+
{
31+
source: "/docs/rules/ensure-forward-ref-using-ref",
32+
destination: "/docs/rules/no-useless-forward-ref",
33+
permanent: true,
34+
},
35+
{
36+
source: "/docs/rules/no-nested-components",
37+
destination: "/docs/rules/no-nested-component-definitions",
38+
permanent: true,
39+
},
40+
{
41+
source: "/docs/rules/dom-no-children-in-void-dom-elements",
42+
destination: "/docs/rules/dom-no-void-elements-with-children",
43+
permanent: true,
44+
},
45+
{
46+
source: "/docs/rules/hooks-extra-ensure-use-memo-has-non-empty-deps",
47+
destination: "/docs/rules/hooks-extra-no-unnecessary-use-memo",
48+
permanent: true,
49+
},
50+
{
51+
source: "/docs/rules/hooks-extra-ensure-use-callback-has-non-empty-deps",
52+
destination: "/docs/rules/hooks-extra-no-unnecessary-use-callback",
53+
permanent: true,
54+
},
55+
{
56+
source: "/docs/rules/hooks-extra-ensure-custom-hooks-using-other-hooks",
57+
destination: "/docs/rules/hooks-extra-no-unnecessary-use-prefix",
58+
permanent: true,
59+
},
60+
{
61+
source: "/docs/rules/hooks-extra-no-redundant-custom-hook",
62+
destination: "/docs/rules/hooks-extra-no-unnecessary-use-prefix",
63+
permanent: true,
64+
},
65+
{
66+
source: "/docs/rules/hooks-extra-no-useless-custom-hooks",
67+
destination: "/docs/rules/hooks-extra-no-unnecessary-use-prefix",
68+
permanent: true,
69+
},
70+
] as const;

apps/website/next.config.mjs

Lines changed: 8 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,11 @@
1-
import { createMDX } from "fumadocs-mdx/next";
1+
// @ts-check
22

3-
const withMDX = createMDX();
3+
import * as importx from "importx";
44

5-
/** @type {import('next').NextConfig} */
6-
const config = {
7-
reactStrictMode: true,
8-
experimental: {
9-
// ppr: true,
10-
inlineCss: true,
11-
// reactCompiler: true,
12-
// viewTransition: true,
13-
},
14-
typescript: {
15-
ignoreBuildErrors: true,
16-
},
17-
eslint: {
18-
ignoreDuringBuilds: true,
19-
},
20-
serverExternalPackages: [
21-
"typescript",
22-
"twoslash",
23-
],
24-
redirects() {
25-
return [
26-
{
27-
source: "/docs",
28-
destination: "/docs/getting-started",
29-
permanent: true,
30-
},
31-
{
32-
source: "/docs/installation",
33-
destination: "/docs/getting-started",
34-
permanent: true,
35-
},
36-
{
37-
source: "/docs/getting-started",
38-
destination: "/docs/getting-started/javascript",
39-
permanent: true,
40-
},
41-
{
42-
source: "/docs/getting-started/javascript-with-alternative-parser",
43-
destination: "/docs/using-an-alternative-parser/babel-eslint-parser",
44-
permanent: true,
45-
},
46-
{
47-
source: "/docs/getting-started/typescript-with-alternative-parser",
48-
destination: "/docs/using-an-alternative-parser/ts-blank-eslint-parser",
49-
permanent: true,
50-
},
51-
{
52-
source: "/docs/rules",
53-
destination: "/docs/rules/overview",
54-
permanent: true,
55-
},
56-
{
57-
source: "/faq",
58-
destination: "/docs/faq",
59-
permanent: true,
60-
},
61-
{
62-
source: "/roadmap",
63-
destination: "/docs/roadmap",
64-
permanent: true,
65-
},
66-
{
67-
source: "/presets/:wildcard",
68-
destination: "/docs/presets/:wildcard",
69-
permanent: true,
70-
},
71-
{
72-
source: "/rules/:wildcard",
73-
destination: "/docs/rules/:wildcard",
74-
permanent: true,
75-
},
76-
// Redirects for deprecated rules
77-
{
78-
source: "/docs/rules/use-jsx-vars",
79-
destination: "/docs/rules/jsx-uses-vars",
80-
permanent: true,
81-
},
82-
{
83-
source: "/docs/rules/jsx-no-duplicate-props",
84-
destination: "/docs/rules/jsx-no-duplicate-props",
85-
permanent: true,
86-
},
87-
{
88-
source: "/docs/rules/no-complicated-conditional-rendering",
89-
destination: "/docs/rules/no-complex-conditional-rendering",
90-
permanent: true,
91-
},
92-
{
93-
source: "/docs/rules/ensure-forward-ref-using-ref",
94-
destination: "/docs/rules/no-useless-forward-ref",
95-
permanent: true,
96-
},
97-
{
98-
source: "/docs/rules/no-nested-components",
99-
destination: "/docs/rules/no-nested-component-definitions",
100-
permanent: true,
101-
},
102-
{
103-
source: "/docs/rules/dom-no-children-in-void-dom-elements",
104-
destination: "/docs/rules/dom-no-void-elements-with-children",
105-
permanent: true,
106-
},
107-
{
108-
source: "/docs/rules/hooks-extra-ensure-use-memo-has-non-empty-deps",
109-
destination: "/docs/rules/hooks-extra-no-unnecessary-use-memo",
110-
permanent: true,
111-
},
112-
{
113-
source: "/docs/rules/hooks-extra-ensure-use-callback-has-non-empty-deps",
114-
destination: "/docs/rules/hooks-extra-no-unnecessary-use-callback",
115-
permanent: true,
116-
},
117-
{
118-
source: "/docs/rules/hooks-extra-ensure-custom-hooks-using-other-hooks",
119-
destination: "/docs/rules/hooks-extra-no-unnecessary-use-prefix",
120-
permanent: true,
121-
},
122-
{
123-
source: "/docs/rules/hooks-extra-no-redundant-custom-hook",
124-
destination: "/docs/rules/hooks-extra-no-unnecessary-use-prefix",
125-
permanent: true,
126-
},
127-
{
128-
source: "/docs/rules/hooks-extra-no-useless-custom-hooks",
129-
destination: "/docs/rules/hooks-extra-no-unnecessary-use-prefix",
130-
permanent: true,
131-
},
132-
];
133-
},
134-
};
5+
const mod = await importx.import("./next.config.ts", {
6+
cache: true,
7+
loader: "native",
8+
parentURL: import.meta.url,
9+
});
13510

136-
export default withMDX(config);
11+
export default mod.default;

apps/website/next.config.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* eslint-disable perfectionist/sort-objects */
2+
import { createMDX } from "fumadocs-mdx/next";
3+
import * as migration from "./migration";
4+
5+
const withMDX = createMDX();
6+
7+
const config = {
8+
reactStrictMode: true,
9+
experimental: {
10+
// ppr: true,
11+
inlineCss: true,
12+
// reactCompiler: true,
13+
// viewTransition: true,
14+
},
15+
typescript: {
16+
ignoreBuildErrors: true,
17+
},
18+
eslint: {
19+
ignoreDuringBuilds: true,
20+
},
21+
serverExternalPackages: [
22+
"typescript",
23+
"twoslash",
24+
],
25+
async redirects() {
26+
return [
27+
{
28+
source: "/docs",
29+
destination: "/docs/getting-started",
30+
permanent: true,
31+
},
32+
{
33+
source: "/docs/installation",
34+
destination: "/docs/getting-started",
35+
permanent: true,
36+
},
37+
{
38+
source: "/docs/getting-started",
39+
destination: "/docs/getting-started/javascript",
40+
permanent: true,
41+
},
42+
{
43+
source: "/docs/rules",
44+
destination: "/docs/rules/overview",
45+
permanent: true,
46+
},
47+
{
48+
source: "/faq",
49+
destination: "/docs/faq",
50+
permanent: true,
51+
},
52+
{
53+
source: "/roadmap",
54+
destination: "/docs/roadmap",
55+
permanent: true,
56+
},
57+
{
58+
source: "/presets/:wildcard",
59+
destination: "/docs/presets/:wildcard",
60+
permanent: true,
61+
},
62+
{
63+
source: "/rules/:wildcard",
64+
destination: "/docs/rules/:wildcard",
65+
permanent: true,
66+
},
67+
...migration.redirects,
68+
];
69+
},
70+
};
71+
72+
export default withMDX(config);

apps/website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"eslint-plugin-react-hooks": "^5.2.0",
5656
"eslint-plugin-react-refresh": "^0.4.19",
5757
"eslint-plugin-unicorn": "^58.0.0",
58+
"importx": "^0.5.2",
5859
"postcss": "^8.5.3",
5960
"tailwindcss": "^4.0.15",
6061
"tailwindcss-animated": "^2.0.0",

packages/plugins/eslint-plugin-react-x/src/rules/jsx-no-undef.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
title: jsx-no-undef
33
---
44

5+
<Callout type="warn" title="CAUTION">
6+
7+
**This rule hasn’t been released yet. If you want to try it, you can install the `beta` version of the plugin.**
8+
9+
</Callout>
10+
511
**Full Name in `eslint-plugin-react-x`**
612

713
```plain copy

pnpm-lock.yaml

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

scripts/update-website.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const [
2020
const title = isPluginX
2121
? basename
2222
: `${catename}/${basename}`;
23-
const dest = path.join("apps", "website", "content", "docs", "rules", `${name}.md`);
23+
const dest = path.join("apps", "website", "content", "docs", "rules", `${name}.mdx`);
2424
return [[...files, [doc, dest]], [...rules, [name, title]]] as const;
2525
},
2626
[[], []],

0 commit comments

Comments
 (0)