From 578c7cfeb4c2265daf3e91c607ffa3cf7f0b67aa Mon Sep 17 00:00:00 2001 From: Rel1cx Date: Thu, 27 Mar 2025 23:56:31 +0800 Subject: [PATCH] feat(website): add community section and integrate bsky-react-post component --- README.md | 2 +- apps/website/app/(home)/page.tsx | 40 +++++++++++++++++++ apps/website/app/layout.config.tsx | 15 ++++++- apps/website/app/overrides.css | 4 ++ apps/website/components/widgets/bsky-post.tsx | 17 ++++++++ .../components/widgets/community-presets.tsx | 34 ++++++++++++++++ apps/website/content/docs/community.mdx | 31 ++++++++++++++ .../docs/getting-started/javascript.mdx | 1 - .../docs/getting-started/typescript.mdx | 1 - apps/website/content/docs/meta.json | 2 +- apps/website/content/docs/used-by.mdx | 21 ---------- apps/website/package.json | 1 + packages/plugins/eslint-plugin/README.md | 2 +- pnpm-lock.yaml | 34 ++++++++++++++++ 14 files changed, 177 insertions(+), 28 deletions(-) create mode 100644 apps/website/components/widgets/bsky-post.tsx create mode 100644 apps/website/components/widgets/community-presets.tsx create mode 100644 apps/website/content/docs/community.mdx delete mode 100644 apps/website/content/docs/used-by.mdx diff --git a/README.md b/README.md index f226f39329..62d586a217 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ More than 80 high-quality linting rules to identify possible problems in your Re ### All-In-One -- [`@eslint-react/eslint-plugin`](https://www.npmjs.com/package/@eslint-react/eslint-plugin) - Main plugin combining all rules and presets from the above packages. +- [`@eslint-react/eslint-plugin`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin) - Main plugin combining all rules and presets from the above packages. ## Installation diff --git a/apps/website/app/(home)/page.tsx b/apps/website/app/(home)/page.tsx index d75d75cf6f..5e5974ddc5 100644 --- a/apps/website/app/(home)/page.tsx +++ b/apps/website/app/(home)/page.tsx @@ -1,4 +1,5 @@ import { ESLintReact } from "#/components/eslint-react"; + import { Card, Cards } from "fumadocs-ui/components/card"; import { Link } from "next-view-transitions"; @@ -10,6 +11,39 @@ const features = [ ["Comprehensive", "Handles complex scenarios and identifies problems that other tools might miss."], ] as const; +const plugins = [ + [ + "eslint-plugin-react-x", + "Core rules (renderer-agnostic, compatible with x-platform).", + "https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x", + ], + [ + "eslint-plugin-react-dom", + "DOM specific rules for React DOM.", + "https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom", + ], + [ + "eslint-plugin-react-web-api", + "Rules for interacting with Web APIs.", + "https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-web-api", + ], + [ + "eslint-plugin-react-hooks-extra", + "Extra React Hooks rules.", + "https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra", + ], + [ + "eslint-plugin-react-naming-convention", + "Naming convention rules.", + "https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention", + ], + [ + "@eslint-react/eslint-plugin", + "Main plugin combining all rules and presets from the above packages.", + "https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin", + ], +] as const; + export default function HomePage() { return (
@@ -22,6 +56,12 @@ export default function HomePage() { {features.map(([title, description]) => )} +

ESLint Plugins

+ + {plugins.map(([title, description, href]) => ( + + ))} +

Roadmap

Check out the roadmap to see what's planned for the future. diff --git a/apps/website/app/layout.config.tsx b/apps/website/app/layout.config.tsx index 62ea069f4f..0458580112 100644 --- a/apps/website/app/layout.config.tsx +++ b/apps/website/app/layout.config.tsx @@ -32,13 +32,24 @@ export const baseOptions: BaseLayoutProps = { }, { active: "nested-url", - text: "Roadmap", - url: "/docs/roadmap", + text: "Community", + url: "/docs/community", }, { + active: "nested-url", text: "Changelog", url: "/docs/changelog", }, + { + active: "nested-url", + text: "Roadmap", + url: "/docs/roadmap", + }, + { + active: "nested-url", + text: "FAQ", + url: "/FAQ", + }, ], nav: { title: ( diff --git a/apps/website/app/overrides.css b/apps/website/app/overrides.css index 507d8657e0..5ea42960d9 100644 --- a/apps/website/app/overrides.css +++ b/apps/website/app/overrides.css @@ -83,3 +83,7 @@ figure.fd-codeblock.shiki { /* improve code block readability */ background-color: color-mix(in oklab, var(--color-fd-secondary) 25%, transparent); } + +.bsky-post [class^="embed-module_externalThumbnail"] { + display: none; +} diff --git a/apps/website/components/widgets/bsky-post.tsx b/apps/website/components/widgets/bsky-post.tsx new file mode 100644 index 0000000000..9ec48190a2 --- /dev/null +++ b/apps/website/components/widgets/bsky-post.tsx @@ -0,0 +1,17 @@ +import { cn } from "#/lib/cn"; +import { Post } from "bsky-react-post"; +import "bsky-react-post/theme.css"; + +export interface BskyPostProps { + id: string; + classNames?: string; + handle: string; +} + +export function BskyPost({ id, classNames, handle }: BskyPostProps) { + return ( +

+ +
+ ); +} diff --git a/apps/website/components/widgets/community-presets.tsx b/apps/website/components/widgets/community-presets.tsx new file mode 100644 index 0000000000..50a7f5f77a --- /dev/null +++ b/apps/website/components/widgets/community-presets.tsx @@ -0,0 +1,34 @@ +import { Card, Cards } from "fumadocs-ui/components/card"; + +const presets = [ + { + description: "Anthony's ESLint config preset", + name: "antfu/eslint-config", + link: "https://github.com/antfu/eslint-config", + }, + { + description: "Rebecca's ESLint config preset", + name: "eslint-config-rebeccastevens", + link: "https://github.com/RebeccaStevens/eslint-config-rebeccastevens", + }, + { + description: "A comprehensive and opinionated Typescript-first ESLint configuration", + name: "eslint-config-sheriff", + link: "https://github.com/AndreaPontrandolfo/sheriff", + }, + { + description: "Sukka's ESLint config preset", + name: "eslint-config-sukka", + link: "https://github.com/SukkaW/eslint-config-sukka", + }, +]; + +export function CommunityPresets() { + return ( + + {presets.map((preset) => ( + + ))} + + ); +} diff --git a/apps/website/content/docs/community.mdx b/apps/website/content/docs/community.mdx new file mode 100644 index 0000000000..a7bdba517a --- /dev/null +++ b/apps/website/content/docs/community.mdx @@ -0,0 +1,31 @@ +--- +title: Community +description: "Discover the growing community around ESLint React" +--- + +import { BskyPost } from "../../components/widgets/bsky-post"; +import { CommunityPresets } from "../../components/widgets/community-presets"; + +## OSS Projects Using ESLint React + +[![used-by](/used_by.png)](https://github.com/Rel1cx/eslint-react/blob/main/assets/NOTABLE_PROJECTS_USING_ESLINT_REACT) + + + +_Data collected from GitHub dependents network, if there are any mismatch or outdated information, feel free to [open issue](https://github.com/Rel1cx/eslint-react/issues/new?assignees=&labels=type%3A+documentation&projects=&template=docs_report.md&title=%5Bdocs%5D+) or pull request._ + + + +## Adoption Feedback on Social Media + + + +Find more on [https://x.com/search?q=eslint-react.xyz](https://x.com/search?q=eslint-react.xyz&src=typed_query&f=live). + +--- + +## See Also + +**Community Maintained Presets** + + diff --git a/apps/website/content/docs/getting-started/javascript.mdx b/apps/website/content/docs/getting-started/javascript.mdx index d5404a3dd2..77235f4eb5 100644 --- a/apps/website/content/docs/getting-started/javascript.mdx +++ b/apps/website/content/docs/getting-started/javascript.mdx @@ -62,4 +62,3 @@ export default defineConfig([ - [Configure ESLint](https://eslint.org/docs/latest/use/configure/) - [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) -- [WebStorm ESLint integration](https://www.jetbrains.com/help/webstorm/eslint.html) diff --git a/apps/website/content/docs/getting-started/typescript.mdx b/apps/website/content/docs/getting-started/typescript.mdx index 78c9772c9c..0d302deedc 100644 --- a/apps/website/content/docs/getting-started/typescript.mdx +++ b/apps/website/content/docs/getting-started/typescript.mdx @@ -59,4 +59,3 @@ export default tseslint.config({ - [Configure ESLint](https://eslint.org/docs/latest/use/configure/) - [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) -- [WebStorm ESLint integration](https://www.jetbrains.com/help/webstorm/eslint.html) diff --git a/apps/website/content/docs/meta.json b/apps/website/content/docs/meta.json index 2db6d6eee8..dd3cda5d7f 100644 --- a/apps/website/content/docs/meta.json +++ b/apps/website/content/docs/meta.json @@ -10,9 +10,9 @@ "!advanced-configuration", "!using-an-alternative-parser", "---Other---", + "community", "changelog", "roadmap", - "used-by", "faq" ] } diff --git a/apps/website/content/docs/used-by.mdx b/apps/website/content/docs/used-by.mdx deleted file mode 100644 index 15f84c010e..0000000000 --- a/apps/website/content/docs/used-by.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Used by -description: ESLint React is used by many projects, including some of the most popular ones in the React ecosystem. ---- - -## Notable Projects Using ESLint React - -[![used-by](/used_by.png)](https://github.com/Rel1cx/eslint-react/blob/main/assets/NOTABLE_PROJECTS_USING_ESLINT_REACT) - -## Community ESLint Configs Adopting ESLint React - -- [`antfu/eslint-config`](https://github.com/antfu/eslint-config) - Anthony's ESLint config preset. -- [`eslint-config-rebeccastevens`](https://github.com/RebeccaStevens/eslint-config-rebeccastevens) - Rebecca's ESLint config preset. -- [`eslint-config-sheriff`](https://github.com/AndreaPontrandolfo/sheriff) - A comprehensive and opinionated Typescript-first ESLint configuration. -- [`eslint-config-sukka`](https://github.com/SukkaW/eslint-config-sukka) - Sukka's ESLint config preset. - - - -_Data collected from GitHub dependents network, if there are any mismatch or outdated information, feel free to [open issue](https://github.com/Rel1cx/eslint-react/issues/new?assignees=&labels=type%3A+documentation&projects=&template=docs_report.md&title=%5Bdocs%5D+) or pull request._ - - diff --git a/apps/website/package.json b/apps/website/package.json index dfcbfa9af1..92a8642ff6 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@chevrotain/regexp-to-ast": "^11.0.3", + "bsky-react-post": "^0.1.7", "clsx": "^2.1.1", "fumadocs-core": "15.0.14", "fumadocs-docgen": "2.0.0", diff --git a/packages/plugins/eslint-plugin/README.md b/packages/plugins/eslint-plugin/README.md index f226f39329..62d586a217 100644 --- a/packages/plugins/eslint-plugin/README.md +++ b/packages/plugins/eslint-plugin/README.md @@ -26,7 +26,7 @@ More than 80 high-quality linting rules to identify possible problems in your Re ### All-In-One -- [`@eslint-react/eslint-plugin`](https://www.npmjs.com/package/@eslint-react/eslint-plugin) - Main plugin combining all rules and presets from the above packages. +- [`@eslint-react/eslint-plugin`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin) - Main plugin combining all rules and presets from the above packages. ## Installation diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4265366a6b..6bcf4d865d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -265,6 +265,9 @@ importers: '@chevrotain/regexp-to-ast': specifier: ^11.0.3 version: 11.0.3 + bsky-react-post: + specifier: ^0.1.7 + version: 0.1.7(react@19.0.0)(swr@2.3.3(react@19.0.0)) clsx: specifier: ^2.1.1 version: 2.1.1 @@ -4045,6 +4048,12 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true + bsky-react-post@0.1.7: + resolution: {integrity: sha512-c+M94RCQQmEHKaB93tAJ42SnrL6nKHlaI4qRRKMy0+Lqo0osksKaW+VNya5iQXihp1Mx59zM1WEVdd9OyHrteQ==} + peerDependencies: + react: ^19.0.0 + swr: ^2.2.5 + buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} @@ -6497,6 +6506,11 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + swr@2.3.3: + resolution: {integrity: sha512-dshNvs3ExOqtZ6kJBaAsabhPdHyeY4P2cKwRCniDVifBMoG/SVI7tfLWqPXriVspf2Rg4tPzXJTnwaihIeFw2A==} + peerDependencies: + react: ^19.0.0 + synckit@0.9.2: resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -6776,6 +6790,11 @@ packages: '@types/react': optional: true + use-sync-external-store@1.4.0: + resolution: {integrity: sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==} + peerDependencies: + react: ^19.0.0 + util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -9683,6 +9702,11 @@ snapshots: node-releases: 2.0.19 update-browserslist-db: 1.1.3(browserslist@4.24.4) + bsky-react-post@0.1.7(react@19.0.0)(swr@2.3.3(react@19.0.0)): + dependencies: + react: 19.0.0 + swr: 2.3.3(react@19.0.0) + buffer@5.7.1: dependencies: base64-js: 1.5.1 @@ -12732,6 +12756,12 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} + swr@2.3.3(react@19.0.0): + dependencies: + dequal: 2.0.3 + react: 19.0.0 + use-sync-external-store: 1.4.0(react@19.0.0) + synckit@0.9.2: dependencies: '@pkgr/core': 0.1.2 @@ -13023,6 +13053,10 @@ snapshots: optionalDependencies: '@types/react': 19.0.12 + use-sync-external-store@1.4.0(react@19.0.0): + dependencies: + react: 19.0.0 + util-deprecate@1.0.2: {} valibot@1.0.0(typescript@5.8.2):