Skip to content

Commit ca2d8a2

Browse files
Rel1cxCopilotCopilot
authored
Add React Server Components (RSC) plugin (#1457)
Signed-off-by: REL1CX <solarflamex@hotmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 13d7669 commit ca2d8a2

45 files changed

Lines changed: 445 additions & 51 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,29 @@
22

33
### ✨ New
44

5-
- Rename `no-non-async-server-functions` to `rsc-no-misused-use-server`
5+
- Migrate `no-non-async-server-functions` rule to `rsc/function-definition` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1450
6+
- Add a new `eslint-plugin-react-rsc` sub-plugin for React Server Components (RSC) rules.
7+
- Add a new `rsc` preset to enable RSC rules.
8+
- Add a new `disable-rsc` preset to disable RSC rules.
9+
10+
### 🐞 Fixes
11+
12+
- Move grouped docs from the global overview to per-plugin READMEs by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1449
613

714
### 📝 Changes you should be aware of
815

9-
The `no-non-async-server-functions` rule has been renamed to `rsc-no-misused-use-server`. Please update your configuration accordingly if you are using it.
16+
The `no-non-async-server-functions` rule has been migrated to `rsc/function-definition`. Please update your configuration accordingly if you are using it.
17+
18+
**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v2.8.4...v2.9.0
1019

1120
## v2.8.4 (2026-02-01)
1221

1322
### 🐞 Fixes
1423

1524
- Change status of `jsx-shorthand-boolean` rule in migration table by @connorshea in https://github.com/Rel1cx/eslint-react/pull/1446
1625
- Fix rule name in docs for `debug/is-from-ref` by @amir-rahmanii in https://github.com/Rel1cx/eslint-react/pull/1445
17-
- Fix rule name in docs for `rsc-no-misused-use-server` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1447
18-
- Mark `rsc-no-misused-use-server` as experimental by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1448
26+
- Fix rule name in docs for `no-non-async-server-functions` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1447
27+
- Mark `no-non-async-server-functions` as experimental by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1448
1928

2029
## New Contributors
2130

@@ -27,7 +36,7 @@ The `no-non-async-server-functions` rule has been renamed to `rsc-no-misused-use
2736

2837
### ✨ New
2938

30-
- feat(#1435): implements `rsc-no-misused-use-server` by @SukkaW in https://github.com/Rel1cx/eslint-react/pull/1443
39+
- feat(#1435): implements `no-non-async-server-functions` by @SukkaW in https://github.com/Rel1cx/eslint-react/pull/1443
3140

3241
**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v2.8.1...v2.8.3
3342

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.9.0-beta.0
1+
2.9.0

apps/website/content/docs/changelog.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,29 @@ title: Changelog
66

77
### ✨ New
88

9-
- Rename `no-non-async-server-functions` to `rsc-no-misused-use-server`
9+
- Migrate `no-non-async-server-functions` rule to `rsc/function-definition` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1450
10+
- Add a new `eslint-plugin-react-rsc` sub-plugin for React Server Components (RSC) rules.
11+
- Add a new `rsc` preset to enable RSC rules.
12+
- Add a new `disable-rsc` preset to disable RSC rules.
13+
14+
### 🐞 Fixes
15+
16+
- Move grouped docs from the global overview to per-plugin READMEs by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1449
1017

1118
### 📝 Changes you should be aware of
1219

13-
The `no-non-async-server-functions` rule has been renamed to `rsc-no-misused-use-server`. Please update your configuration accordingly if you are using it.
20+
The `no-non-async-server-functions` rule has been migrated to `rsc/function-definition`. Please update your configuration accordingly if you are using it.
21+
22+
**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v2.8.4...v2.9.0
1423

1524
## v2.8.4 (2026-02-01)
1625

1726
### 🐞 Fixes
1827

1928
- Change status of `jsx-shorthand-boolean` rule in migration table by @connorshea in https://github.com/Rel1cx/eslint-react/pull/1446
2029
- Fix rule name in docs for `debug/is-from-ref` by @amir-rahmanii in https://github.com/Rel1cx/eslint-react/pull/1445
21-
- Fix rule name in docs for `rsc-no-misused-use-server` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1447
22-
- Mark `rsc-no-misused-use-server` as experimental by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1448
30+
- Fix rule name in docs for `no-non-async-server-functions` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1447
31+
- Mark `no-non-async-server-functions` as experimental by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1448
2332

2433
## New Contributors
2534

@@ -31,7 +40,7 @@ The `no-non-async-server-functions` rule has been renamed to `rsc-no-misused-use
3140

3241
### ✨ New
3342

34-
- feat(#1435): implements `rsc-no-misused-use-server` by @SukkaW in https://github.com/Rel1cx/eslint-react/pull/1443
43+
- feat(#1435): implements `no-non-async-server-functions` by @SukkaW in https://github.com/Rel1cx/eslint-react/pull/1443
3544

3645
**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v2.8.1...v2.8.3
3746

apps/website/content/docs/rules/meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"prefer-namespace-import",
6666
"prefer-read-only-props",
6767
"prefer-use-state-lazy-initialization",
68-
"rsc-no-misused-use-server",
6968
"---DOM Rules---",
7069
"dom-no-dangerously-set-innerhtml",
7170
"dom-no-dangerously-set-innerhtml-with-children",
@@ -85,6 +84,8 @@
8584
"dom-no-use-form-state",
8685
"dom-no-void-elements-with-children",
8786
"dom-prefer-namespace-import",
87+
"---RSC Rules---",
88+
"rsc-function-definition",
8889
"---Web API Rules---",
8990
"web-api-no-leaked-event-listener",
9091
"web-api-no-leaked-interval",

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ full: true
9090
| [`prefer-namespace-import`](prefer-namespace-import) | 0️⃣ 0️⃣ | `🔧` | Enforces importing React via a namespace import | |
9191
| [`prefer-read-only-props`](prefer-read-only-props) | 0️⃣ 0️⃣ | `💭` `🧪` | Enforces read-only props in components | |
9292
| [`prefer-use-state-lazy-initialization`](prefer-use-state-lazy-initialization) | 1️⃣ 1️⃣ | | Enforces wrapping function calls made inside `useState` in an `initializer function` | |
93-
| [`rsc-no-misused-use-server`](rsc-no-misused-use-server) | 0️⃣ 0️⃣ | `🔧` `🧪` | Disallows non-async [React Server Functions](https://react.dev/reference/rsc/server-functions) | |
9493

9594
## DOM Rules
9695

@@ -119,6 +118,16 @@ full: true
119118
| [`no-void-elements-with-children`](dom-no-void-elements-with-children) | 2️⃣ 2️⃣ | | Disallows `children` in void DOM elements | |
120119
| [`prefer-namespace-import`](dom-prefer-namespace-import) | 0️⃣ 0️⃣ | `🔧` | Enforces importing React DOM via a namespace import | |
121120

121+
## RSC Rules
122+
123+
<Callout type="info">
124+
RSC rules target [React Server Components](https://react.dev/reference/rsc/server-components), [React Server Functions](https://react.dev/reference/rsc/server-functions) and RSC [Directives](https://react.dev/reference/rsc/directives).
125+
</Callout>
126+
127+
| Rule || 🌟 | Description | `react` |
128+
| :--------------------------------------------------------------------------------- | :-----: | :-------: | :---------------------------------------------------------------------------------------------------------------------------- | :------: |
129+
| [`function-definition`](rsc-function-definition) | 0️⃣ 0️⃣ | `🔧` `🧪` | Validate and transform React Server/Client Function definitions | >=19.0.0 |
130+
122131
## Web API Rules
123132

124133
<Callout type="info">

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"name": "@eslint-react/monorepo",
3-
"version": "2.9.0-beta.0",
3+
"version": "2.9.0",
44
"private": true,
5-
"description": "Monorepo for eslint-plugin-react-[x, dom, web-api, hooks-extra, naming-convention].",
5+
"description": "Monorepo for eslint-plugin-react-[x, dom, rsc, web-api, hooks-extra, naming-convention].",
66
"keywords": [
77
"react",
88
"eslint",
99
"eslint-react",
1010
"eslint-plugin",
1111
"eslint-plugin-react-x",
1212
"eslint-plugin-react-dom",
13+
"eslint-plugin-react-rsc",
1314
"eslint-plugin-react-web-api",
1415
"eslint-plugin-react-hooks-extra",
1516
"eslint-plugin-react-naming-convention"

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eslint-react/core",
3-
"version": "2.9.0-beta.0",
3+
"version": "2.9.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

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eslint-plugin-react-dom",
3-
"version": "2.9.0-beta.0",
4-
"description": "ESLint React's ESLint plugin for React DOM related rules.",
3+
"version": "2.9.0",
4+
"description": "ESLint React's ESLint plugin for DOM related rules.",
55
"keywords": [
66
"react",
77
"dom",

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

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

0 commit comments

Comments
 (0)