eslint-plugin-react-server-components

1.2.0 • Public • Published

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

npm install --save-dev eslint-plugin-react-server-components

Configuration

To use the recommended configuration:

// eslintrc.json
{
  extends: ["plugin:react-server-components/recommended"],
}

Rules

use-client

Enforce components are appropriately prefixed with 'use client'.

{
  "rules": {
    "react-server-components/use-client": "error"
  }
}

/eslint-plugin-react-server-components/

    Package Sidebar

    Install

    npm i eslint-plugin-react-server-components

    Weekly Downloads

    13,621

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    49.3 kB

    Total Files

    9

    Last publish

    Collaborators

    • roginfarrer