Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roginfarrer/eslint-plugin-react-server-components
ESLint rule for enforcing "use client" in React client components
https://github.com/roginfarrer/eslint-plugin-react-server-components
eslint eslint-plugin eslint-rules next nextjs react react-server-components
Last synced: about 1 month ago
JSON representation
ESLint rule for enforcing "use client" in React client components
- Host: GitHub
- URL: https://github.com/roginfarrer/eslint-plugin-react-server-components
- Owner: roginfarrer
- License: mit
- Created: 2023-03-01T16:44:45.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-15T04:40:49.000Z (11 months ago)
- Last Synced: 2024-03-15T05:21:58.527Z (10 months ago)
- Topics: eslint, eslint-plugin, eslint-rules, next, nextjs, react, react-server-components
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 20
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-react-server-components
Experiment in making an ESLint rule for enforcing `"use client"` in client components (and warning if it's not needed).
## Installation
```bash
npm install --save-dev eslint-plugin-react-server-components
```## Configuration
To use the recommended configuration:
```json5
// eslintrc.json
{
extends: ["plugin:react-server-components/recommended"],
}
```## Rules
### `use-client`
> Enforce components are appropriately prefixed with `'use client'.`
```json
{
"rules": {
"react-server-components/use-client": "error"
}
}
```