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

eslint-plugin-pnpm-catalog

v0.0.1

Published

eslint plugin to automatically reorganize pnpm catalogs

Downloads

20

Readme

eslint-plugin-pnpm-catalog

npm version npm downloads bundle JSDocs License

ESLint plugin that enforces the use of named catalogs in pnpm workspaces. Automatically migrates plain dependency specifiers to catalog references and organizes them into categorized catalogs.

Features

  • 🔧 Automatic migration: Converts plain version specifiers to catalog references
  • 📦 Smart categorization: Automatically categorizes dependencies into appropriate catalogs (e.g., frontend, dev, testing)
  • 🎯 Custom rules: Define your own categorization rules with regex patterns or exact matches
  • Conflict resolution: Handles version conflicts with configurable strategies
  • 🛠️ Auto-fix: Automatically updates both package.json and pnpm-workspace.yaml

Installation

pnpm install --save-dev eslint-plugin-pnpm-catalog

Usage

Add the plugin to your ESLint config (Flat Config):

import eslintCatalogPlugin from 'eslint-plugin-pnpm-catalog'

export default [
  {
    files: ['package.json'],
    plugins: {
      'pnpm-catalog': eslintCatalogPlugin,
    },
    rules: {
      'pnpm-catalog/json-enforce-named-catalogs': 'warn',
    },
  },
]

Or use the recommended configuration:

import eslintCatalogPlugin from 'eslint-plugin-pnpm-catalog'

export default [
  eslintCatalogPlugin.configs.recommended,
]

Rules

json-enforce-named-catalogs

Enforces the use of named catalogs instead of plain version specifiers in package.json files. This rule helps maintain consistency across your workspace by organizing dependencies into logical catalogs.

Options

{
  allowedProtocols?: string[]          // Default: ['workspace', 'link', 'file']
  autofix?: boolean                    // Default: true
  conflicts?: 'new-catalog' | 'overrides' | 'error'  // Default: 'new-catalog'
  fields?: string[]                    // Default: ['dependencies', 'devDependencies']
  customRules?: CatalogRule[]          // Default: []
}
allowedProtocols

Array of protocol prefixes that should not be converted to catalogs (e.g., workspace:, link:, file:).

autofix

Whether to automatically fix violations by updating both package.json and pnpm-workspace.yaml.

conflicts

Strategy for handling version conflicts when adding packages to existing catalogs:

  • new-catalog: Create a new catalog for conflicting versions
  • overrides: Override the existing catalog entry
  • error: Report an error without fixing
fields

Array of package.json fields to check for dependencies.

customRules

Array of custom categorization rules:

interface CatalogRule {
  name: string // Catalog name
  match: string | string[] // Package name patterns (supports regex)
  depFields?: string[] // Dependency fields this rule applies to
  priority?: number // Rule priority (higher = more important)
}

Examples

Basic usage:

// package.json (before)
{
  "dependencies": {
    "react": "^18.0.0",
    "vue": "^3.5.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0"
  }
}
// package.json (after)
{
  "dependencies": {
    "react": "catalog:frontend",
    "vue": "catalog:frontend"
  },
  "devDependencies": {
    "@types/node": "catalog:dev"
  }
}
# pnpm-workspace.yaml (updated)
catalogs:
  frontend:
    react: ^18.0.0
    vue: ^3.5.0
  dev:
    '@types/node': ^20.0.0

With custom rules:

{
  "rules": {
    "pnpm-catalog/json-enforce-named-catalogs": ["warn", {
      "customRules": [
        {
          "name": "ui-components",
          "match": ["@mui/*", "@chakra-ui/*", "antd"],
          "priority": 100
        },
        {
          "name": "testing",
          "match": "^(vitest|jest|@testing-library/)",
          "depFields": ["devDependencies"],
          "priority": 90
        }
      ]
    }]
  }
}

Conflict handling:

{
  "rules": {
    "pnpm-catalog/json-enforce-named-catalogs": ["warn", {
      "conflicts": "new-catalog" // Creates new catalogs for conflicts
    }]
  }
}

Acknowledgments

This work has been inspired by the work of pncat.

Also special thanks to Anthony Fu for:

License

MIT License © onmax