An ESLint plugin to enforce and auto-fix pnpm catalog usage in monorepos. Current stable version is 1.6.0, released with support for ESLint v10. It provides two sets of rules: JSON rules for package.json (requires jsonc-eslint-parser) and YAML rules for pnpm-workspace.yaml (requires yaml-eslint-parser, experimental). Key differentiators include auto-fixing support, catalog enforcement, duplicate detection, and workspace protocol preferences. Maintained by Anthony Fu, with active development and monthly releases.
npm install eslint-plugin-pnpmVerified import paths — ran on the pinned version, not inferred.
Basic ESLint flat config setup for pnpm workspaces with both JSON and YAML rules.
Use with caution, or disable YAML rules if issues arise.
Ensure the parser is configured in languageOptions.parser for relevant files.
Migrate to flat config; the plugin does not export a deprecated configs object.
Upgrade ESLint to v9 or v10.
Use other JSON rules or manually enforce workspace protocol.
Use import { configs } from 'eslint-plugin-pnpm' and spread configs.json or configs.yaml.Add languageOptions: { parser: jsonc-eslint-parser } in the configuration for package.json files.Run `pnpm add -D eslint-plugin-pnpm` and use import statement without file extensions.
Use the plugin object directly: plugins: { pnpm: pluginPnpm }.