An ESLint plugin providing rules for consistent, readable, and valid package.json files.
eslint-plugin-package-json is an ESLint plugin that provides a comprehensive set of rules to lint and validate package.json files. It ensures that package metadata is consistent, readable, and adheres to npm specifications, helping prevent common errors in dependency management and publishing. The plugin integrates seamlessly into existing ESLint workflows to enforce best practices across projects.
JavaScript and TypeScript developers, especially those working on npm packages, monorepos, or teams that need consistent package.json standards. It's valuable for maintainers who want to automate quality checks for project metadata.
Developers choose this plugin because it offers a specialized, rule-based approach to package.json validation that goes beyond basic JSON linting. Its extensive rule set, monorepo support, and auto-fixable rules provide a robust solution for maintaining high-quality package metadata with minimal effort.
Rules for consistent, readable, and valid package.json files. 🗂️
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enforces that package.json properties like name, version, and exports are valid per npm specifications, with rules like valid-name and valid-exports ensuring compliance.
Provides rules for property ordering, script name casing, and exports subpath formatting, such as order-properties and scripts-name-casing, improving readability across projects.
Lints package.json files at project root and in subfolders, as stated in the README, making it ideal for monorepos with multiple packages.
Many rules support automatic fixes via ESLint's --fix option, like exports-subpaths-style and sort-collections, reducing manual correction effort.
With over 70 rules, configuration can be daunting for small projects, and the extensive list may include unnecessary validations for basic use cases.
Requires ESLint setup, adding complexity for projects not already using it or those with minimal configurations, as it's not a standalone tool.
The documented deprecation policy allows rules to be removed after six months, potentially breaking existing configurations and requiring updates.