npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

eslint-plugin-next-recommended

v1.0.3

Published

ESLint rules for NextJS App Router

Readme

eslint-plugin-next-recommended

This ESLint plugin helps in developing projects with NextJS, using the App Router feature.

Usage Example of rule require-use-client

Installation

Before getting started, ensure that you have ESLint installed.

You can then install this plugin using:

# npm
npm install -D eslint-plugin-next-recommended

# yarn
yarn add -D eslint-plugin-next-recommended

# pnpm
pnpm install -D eslint-plugin-next-recommended

Usage

To start using the plugin, implement it in your ESLint configuration file as follows:

{
  "plugins": [
    // ...
    "next-recommended"
  ]
}

I also recommend that you extend the rules set by default, so that you don't need to add rule by rule inside your ESLint configuration file:

{
  "extends": [
    // ...
    "plugin:next-recommended/recommended"
  ]
}

Custom Configuration

Currently, there isn't much customization to be done, but you can customize the severity of all rules. It is not necessary to implement the code below, but it is an example of how you could modify the severity of each one.

{
  "rules": {
    "next-recommended/require-use-client": "warn",
    "next-recommended/unnecessarily-client-declaration": "warn",
    "next-recommended/async-component-no-hooks": "error",
    "next-recommended/async-server-actions": "off",
    "next-recommended/async-exported-server-actions": "off",
    "next-recommended/export-server-actions-only": "warn"
  }
}

Rules

next-recommended/require-use-client This rule enforces that hooks and interactivity are available only for files declared as "use client". It helps maintain consistency and aligns with Next.js documentation.

next-recommended/unnecessarily-client-declaration This rule identifies components that are declared with "use client" but lack interactivity, resulting in a component that runs unnecessarily on the client side. You can configure this rule to automatically remove the "use client" statement when unnecessary, just follow the example:

{
  "rules": {
    "next-recommended/unnecessarily-client-declaration": ["warn", { "autoFix": true }],
  }
}

next-recommended/async-component-no-hooks For components declared as async, it is expected not to run client-side. Async components are intended to run on the server side and do not support specific client-side functionality such as hooks. This error can often result from inadvertently adding 'use client' to a module originally written for the server. See the Next.js documentation for additional context.

next-recommended/async-server-actions This rule ensures that server actions are declared as async functions, aligning with best practices for server-side functionality.

next-recommended/async-exported-server-actions In server action files, this rule enforces that all exported functions are async, maintaining consistency and preventing NextJS errors. It may be worth highlighting that it is possible to export a non-async function preventing NextJS from generating an error, but I predict that this is not a recommended practice.

next-recommended/export-server-actions-only For server action files, this rule allows only the export of functions related to server actions. Exporting anything other than functions within this context may raise exceptions in Next.js.

Future Features:

  • Rule to control exports within a page;
  • Tests.

Please feel free to make suggestions or report bugs. Let's improve this plugin together.