Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@

### ✨ New

- Rename `no-non-async-server-functions` to `rsc-no-misused-use-server`
- Migrate `no-non-async-server-functions` rule to `rsc/function-definition` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1450
- Add a new `eslint-plugin-react-rsc` sub-plugin for React Server Components (RSC) rules.
- Add a new `rsc` preset to enable RSC rules.
- Add a new `disable-rsc` preset to disable RSC rules.

### 🐞 Fixes

- Move grouped docs from the global overview to per-plugin READMEs by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1449

### 📝 Changes you should be aware of

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.
The `no-non-async-server-functions` rule has been migrated to `rsc/function-definition`. Please update your configuration accordingly if you are using it.

**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v2.8.4...v2.9.0

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

### 🐞 Fixes

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

## New Contributors

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

### ✨ New

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

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

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.9.0-beta.0
2.9.0
19 changes: 14 additions & 5 deletions apps/website/content/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,29 @@ title: Changelog

### ✨ New

- Rename `no-non-async-server-functions` to `rsc-no-misused-use-server`
- Migrate `no-non-async-server-functions` rule to `rsc/function-definition` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1450
- Add a new `eslint-plugin-react-rsc` sub-plugin for React Server Components (RSC) rules.
- Add a new `rsc` preset to enable RSC rules.
- Add a new `disable-rsc` preset to disable RSC rules.

### 🐞 Fixes

- Move grouped docs from the global overview to per-plugin READMEs by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1449

### 📝 Changes you should be aware of

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.
The `no-non-async-server-functions` rule has been migrated to `rsc/function-definition`. Please update your configuration accordingly if you are using it.

**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v2.8.4...v2.9.0

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

### 🐞 Fixes

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

## New Contributors

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

### ✨ New

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

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

Expand Down
3 changes: 2 additions & 1 deletion apps/website/content/docs/rules/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"prefer-namespace-import",
"prefer-read-only-props",
"prefer-use-state-lazy-initialization",
"rsc-no-misused-use-server",
"---DOM Rules---",
"dom-no-dangerously-set-innerhtml",
"dom-no-dangerously-set-innerhtml-with-children",
Expand All @@ -85,6 +84,8 @@
"dom-no-use-form-state",
"dom-no-void-elements-with-children",
"dom-prefer-namespace-import",
"---RSC Rules---",
"rsc-function-definition",
"---Web API Rules---",
"web-api-no-leaked-event-listener",
"web-api-no-leaked-interval",
Expand Down
11 changes: 10 additions & 1 deletion apps/website/content/docs/rules/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ full: true
| [`prefer-namespace-import`](prefer-namespace-import) | 0️⃣ 0️⃣ | `🔧` | Enforces importing React via a namespace import | |
| [`prefer-read-only-props`](prefer-read-only-props) | 0️⃣ 0️⃣ | `💭` `🧪` | Enforces read-only props in components | |
| [`prefer-use-state-lazy-initialization`](prefer-use-state-lazy-initialization) | 1️⃣ 1️⃣ | | Enforces wrapping function calls made inside `useState` in an `initializer function` | |
| [`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) | |

## DOM Rules

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

## RSC Rules

<Callout type="info">
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).
</Callout>

| Rule | ✅ | 🌟 | Description | `react` |
| :--------------------------------------------------------------------------------- | :-----: | :-------: | :---------------------------------------------------------------------------------------------------------------------------- | :------: |
| [`function-definition`](rsc-function-definition) | 0️⃣ 0️⃣ | `🔧` `🧪` | Validate and transform React Server/Client Function definitions | >=19.0.0 |

## Web API Rules

<Callout type="info">
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"name": "@eslint-react/monorepo",
"version": "2.9.0-beta.0",
"version": "2.9.0",
"private": true,
"description": "Monorepo for eslint-plugin-react-[x, dom, web-api, hooks-extra, naming-convention].",
"description": "Monorepo for eslint-plugin-react-[x, dom, rsc, web-api, hooks-extra, naming-convention].",
"keywords": [
"react",
"eslint",
"eslint-react",
"eslint-plugin",
"eslint-plugin-react-x",
"eslint-plugin-react-dom",
"eslint-plugin-react-rsc",
"eslint-plugin-react-web-api",
"eslint-plugin-react-hooks-extra",
"eslint-plugin-react-naming-convention"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint-react/core",
"version": "2.9.0-beta.0",
"version": "2.9.0",
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
"homepage": "https://github.com/Rel1cx/eslint-react",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-debug/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-debug",
"version": "2.9.0-beta.0",
"version": "2.9.0",
"description": "ESLint React's ESLint plugin for debugging related rules.",
"keywords": [
"react",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/eslint-plugin-react-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eslint-plugin-react-dom",
"version": "2.9.0-beta.0",
"description": "ESLint React's ESLint plugin for React DOM related rules.",
"version": "2.9.0",
"description": "ESLint React's ESLint plugin for DOM related rules.",
"keywords": [
"react",
"dom",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-hooks-extra",
"version": "2.9.0-beta.0",
"version": "2.9.0",
"description": "ESLint React's ESLint plugin for React Hooks related rules.",
"keywords": [
"react",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-react-naming-convention",
"version": "2.9.0-beta.0",
"version": "2.9.0",
"description": "ESLint React's ESLint plugin for naming convention related rules.",
"keywords": [
"react",
Expand Down
45 changes: 45 additions & 0 deletions packages/plugins/eslint-plugin-react-rsc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# eslint-plugin-react-rsc

## Install

```sh
# npm
npm install --save-dev eslint-plugin-react-rsc
```

## Setup

```js
// eslint.config.js

// @ts-check
import js from "@eslint/js";
import react from "eslint-plugin-react-x";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

export default defineConfig(
{
files: ["**/*.{ts,tsx}"],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
react.configs.recommended,
],
rules: {
// Put rules you want to override here
"react-rsc/function-definition": "error",
},
},
);
Comment thread
Rel1cx marked this conversation as resolved.
```

## Rules

<Callout type="info">
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).
</Callout>

- [`function-definition`](https://eslint-react.xyz/docs/rules/rsc-function-definition) - Validate and transform React Server/Client Function definitions. (🔧 Fixable, 🧪 Experimental)

<https://eslint-react.xyz/docs/rules/overview#rsc-rules>
69 changes: 69 additions & 0 deletions packages/plugins/eslint-plugin-react-rsc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"name": "eslint-plugin-react-rsc",
"version": "2.9.0",
"description": "ESLint React's ESLint plugin for RSC related rules.",
"keywords": [
"react",
"eslint",
"eslint-react",
"eslint-plugin",
"eslint-plugin-react-rsc"
],
"homepage": "https://github.com/Rel1cx/eslint-react",
"bugs": {
"url": "https://github.com/Rel1cx/eslint-react/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rel1cx/eslint-react.git",
"directory": "packages/plugins/eslint-plugin-react-rsc"
},
"license": "MIT",
"author": "Rel1cx",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./package.json": "./package.json"
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
"./package.json"
],
"scripts": {
"build": "tsdown",
"lint:publish": "publint",
"lint:ts": "tsc --noEmit",
"publish": "pnpm run build && pnpm run lint:publish"
},
"dependencies": {
"@eslint-react/ast": "workspace:*",
"@eslint-react/shared": "workspace:*",
"@eslint-react/var": "workspace:*",
"@typescript-eslint/types": "^8.54.0",
"@typescript-eslint/utils": "^8.54.0",
"ts-pattern": "^5.9.0"
},
"devDependencies": {
"@local/configs": "workspace:*",
"@types/react": "^19.2.10",
"@types/react-dom": "^19.2.3",
"tsdown": "^0.20.1"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <6.0.0"
},
"engines": {
"node": ">=20.19.0"
},
"publishConfig": {
"access": "public"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { RuleConfig } from "@eslint-react/shared";

export const name = "react-rsc/disable-experimental";

export const rules: Record<string, RuleConfig> = {
"react-rsc/function-definition": "off",
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { RuleConfig } from "@eslint-react/shared";

import * as recommended from "./recommended";

export const name = "react-rsc/recommended-typescript";

export const rules = {
...recommended.rules,
} as const satisfies Record<string, RuleConfig>;

export const plugins = {
...recommended.plugins,
};

export const settings = {
...recommended.settings,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { RuleConfig } from "@eslint-react/shared";
import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";

import { plugin } from "../plugin";

export const name = "react-rsc/recommended";

export const rules = {
"react-rsc/function-definition": "error",
} as const satisfies Record<string, RuleConfig>;

export const plugins = {
"react-rsc": plugin,
};

export const settings = {
"react-rsc": DEFAULT_ESLINT_REACT_SETTINGS,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { RuleConfig } from "@eslint-react/shared";

import * as strict from "./strict";

export const name = "react-rsc/strict-typescript";

export const rules = {
...strict.rules,
} as const satisfies Record<string, RuleConfig>;

export const plugins = {
...strict.plugins,
};

export const settings = {
...strict.settings,
};
16 changes: 16 additions & 0 deletions packages/plugins/eslint-plugin-react-rsc/src/configs/strict.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { RuleConfig } from "@eslint-react/shared";
import * as recommended from "./recommended";

export const name = "react-rsc/strict";

export const rules = {
...recommended.rules,
} as const satisfies Record<string, RuleConfig>;

export const plugins = {
...recommended.plugins,
};

export const settings = {
...recommended.settings,
};
Loading
Loading