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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@friendsoftheweb/eslint-plugin

v0.0.5

Published

```bash yarn add -D @friendsoftheweb/eslint-plugin ```

Readme

@friendsoftheweb/eslint-plugin

Installation

yarn add -D @friendsoftheweb/eslint-plugin

Rules

Recommended Rules

friendsoftheweb/ban-chalk

Enforces using styleText from node:util instead of the chalk package.

This rule helps remove the chalk dependency by replacing it with the built-in styleText utility available in Node.js 20+.

Examples

Incorrect:

import chalk from 'chalk';

chalk.red('error');
chalk.bold.red('error');

Correct:

import { styleText } from 'node:util';

styleText('red', 'error');
styleText(['bold', 'red'], 'error');

Note: This rule provides automatic fixes for default imports and most usages. Chained styles (e.g. chalk.bold.red) are converted to an array of formats. Named imports (e.g. import { red } from 'chalk') are flagged but require manual migration.

friendsoftheweb/ban-lodash-import

Enforces importing functions from lodash-es instead of lodash.

This rule helps ensure tree shaking works properly by preferring ES module imports from lodash-es over CommonJS imports from lodash.

Examples

Incorrect:

import _ from 'lodash';
import { map } from 'lodash';
import debounce from 'lodash/debounce';

Correct:

import { map } from 'lodash-es';
import debounce from 'lodash-es/debounce';

Note: This rule provides automatic fixes for most cases, except for lodash/fp imports which require manual migration.

friendsoftheweb/css-module-class-exists

Enforces that class names used from an imported CSS module exist in the module file.

friendsoftheweb/css-module-name-matches

Enforces that a CSS module's filename matches the filename of the importing file.

This rule ensures consistent naming conventions by requiring CSS module files to have the same base name as the file importing them.

friendsoftheweb/valid-server-actions-path

Enforces server actions are exported from file paths that match app/**/_actions.ts or app/**/_actions/**/*.ts.

This rule helps maintain a consistent file structure for Next.js server actions by ensuring they are placed in designated locations.

Future Rules

friendsoftheweb/react-named-func-components

Enforces using named functions when defining React components instead of arrow functions. Component definitions that are wrapped in a function call (e.g. forwardRef()) are allowed to use arrow functions.

This rule promotes better debugging and development experience by ensuring React components are defined as named functions, which provide clearer stack traces and better display names in React DevTools.

Examples

Incorrect:

const Button: FC<PropsWithChildren> = (props) => {
  const { children } = props;

  return <button>{children}</button>;
};

Correct:

function Button(props: PropsWithChildren) {
  const { children } = props;

  return <button>{children}</button>;
}
const Button = forwardRef<HTMLButtonElement, PropsWithChildren>(
  (props, ref) => {
    const { children } = props;

    return <button ref={ref}>{children}</button>;
  },
);

Button.displayName = 'Button';

Example Configurations

Recommended Configuration

import friendsOfTheWeb from '@friendsoftheweb/eslint-plugin';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig([
  { ignores: ['.yarn/**/*'] },
  {
    files: ['**/*.{js,jsx,ts,tsx}'],
    extends: [
      tseslint.configs.recommended,
      friendsOfTheWeb.configs['flat/recommended'],
    ],
  },
]);

Recommended Configuration with React

import friendsOfTheWeb from '@friendsoftheweb/eslint-plugin';
import react from 'eslint-plugin-react';
import reactCompiler from 'eslint-plugin-react-compiler';
import reactHooks from 'eslint-plugin-react-hooks';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig([
  { ignores: ['.yarn/**/*'] },
  {
    files: ['**/*.{js,jsx,ts,tsx}'],
    extends: [
      tseslint.configs.recommended,
      react.configs.flat.recommended,
      react.configs.flat['jsx-runtime'],
      reactHooks.configs.flat.recommended,
      reactCompiler.configs.recommended,
      friendsOfTheWeb.configs['flat/recommended'],
    ],
    settings: {
      react: {
        version: 'detect',
      },
    },
  },
]);

Gradual Adoption

There is an additional configuration that makes it easier to adopt this plugin by only warning about violations.

import friendsOfTheWeb from '@friendsoftheweb/eslint-plugin';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig([
  { ignores: ['.yarn/**/*'] },
  {
    files: ['**/*.{js,jsx,ts,tsx}'],
    extends: [
      tseslint.configs.recommended,
      friendsOfTheWeb.configs['flat/migrate'],
    ],
  },
]);

Future Configuration

This configuration includes all of the recommended rules and additional rules that will be considered violations in the future.

Future rule violations are considered warnings with this configuration.

import friendsOfTheWeb from '@friendsoftheweb/eslint-plugin';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig([
  { ignores: ['.yarn/**/*'] },
  {
    files: ['**/*.{js,jsx,ts,tsx}'],
    extends: [
      tseslint.configs.recommended,
      friendsOfTheWeb.configs['flat/future'],
    ],
  },
]);