README.md

May 15, 2026 Β· View on GitHub

Logo Image

ESLint Plugin: Package JSON

Rules for consistent, readable, and valid package.json files. πŸ—‚οΈ

πŸ‘ͺ All Contributors: 42 πŸ§ͺ Coverage πŸ“ License: MIT πŸ“¦ npm version

Getting Started

See Getting Started for details.

Supported Rules

πŸ’Ό Configurations enabled in.
βœ… Set in the recommended configuration.
πŸ“¦ Set in the recommended-publishable configuration.
🎨 Set in the stylistic configuration.
πŸ”§ Automatically fixable by the --fix CLI option.
πŸ’‘ Manually fixable by editor suggestions.

NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β DescriptionπŸ’ΌπŸ”§πŸ’‘
bin-name-casingEnforce that names for bin properties are in kebab case.πŸŽ¨πŸ’‘
exports-subpaths-styleEnforce consistent format for the exports field (implicit or explicit subpaths).πŸŽ¨πŸ”§
no-empty-fieldsReports on unnecessary empty arrays and objects.βœ… πŸ“¦πŸ’‘
no-redundant-filesPrevents adding unnecessary / redundant files.βœ… πŸ“¦πŸ’‘
no-redundant-publishConfigWarns when publishConfig.access is used in unscoped packages.βœ… πŸ“¦πŸ’‘
order-propertiesPackage properties should be declared in standard orderπŸŽ¨πŸ”§
repository-shorthandEnforce either object or shorthand declaration for repository.βœ… πŸ“¦πŸ”§
require-attributionEnsures that proper attribution is included, requiring that either author or contributors is defined, and that if contributors is present, it should include at least one contributor.βœ… πŸ“¦πŸ’‘
require-authorRequires the author property to be present.
require-binRequires the bin property to be present.
require-bugsRequires the bugs property to be present.
require-bundleDependenciesRequires the bundleDependencies property to be present.
require-contributorsRequires the contributors property to be present.
require-cpuRequires the cpu property to be present.
require-dependenciesRequires the dependencies property to be present.
require-descriptionRequires the description property to be present.βœ… πŸ“¦
require-devDependenciesRequires the devDependencies property to be present.
require-devEnginesRequires the devEngines property to be present.
require-directoriesRequires the directories property to be present.
require-enginesRequires the engines property to be present.
require-exportsRequires the exports property to be present.βœ… πŸ“¦
require-filesRequires the files property to be present.βœ… πŸ“¦
require-fundingRequires the funding property to be present.
require-homepageRequires the homepage property to be present.
require-keywordsRequires the keywords property to be present.
require-licenseRequires the license property to be present.βœ… πŸ“¦
require-mainRequires the main property to be present.
require-manRequires the man property to be present.
require-moduleRequires the module property to be present.
require-nameRequires the name property to be present.βœ… πŸ“¦
require-optionalDependenciesRequires the optionalDependencies property to be present.
require-osRequires the os property to be present.
require-packageManagerRequires the packageManager property to be present.
require-peerDependenciesRequires the peerDependencies property to be present.
require-privateRequires the private property to be present.πŸ”§
require-publishConfigRequires the publishConfig property to be present.
require-repositoryRequires the repository property to be present.βœ… πŸ“¦
require-scriptsRequires the scripts property to be present.
require-sideEffectsRequires the sideEffects property to be present.βœ… πŸ“¦
require-typeRequires the type property to be present.βœ… πŸ“¦πŸ”§
require-typesRequires the types property to be present.
require-versionRequires the version property to be present.βœ… πŸ“¦
restrict-dependency-rangesRestricts the range of dependencies to allow or disallow specific types of ranges.πŸ’‘
restrict-private-propertiesDisallows unnecessary properties in private packages.πŸ”§πŸ’‘
restrict-top-level-propertiesDisallows specified top-level properties in package.json.πŸ’‘
scripts-name-casingEnforce that names for scripts are in kebab case (optionally separated by colons).πŸŽ¨πŸ’‘
sort-collectionsSelected collections must be in a consistent order (lexicographical for most; lifecycle-aware for scripts).βœ… πŸ“¦πŸ”§
specify-peers-locallyRequires that all peer dependencies are also declared as dev dependenciesβœ… πŸ“¦πŸ’‘
unique-dependenciesChecks a dependency isn't specified more than once (i.e. in dependencies and devDependencies)βœ… πŸ“¦πŸ’‘
valid-authorEnforce that the author property is valid.βœ… πŸ“¦
valid-binEnforce that the bin property is valid.βœ… πŸ“¦
valid-browserEnforce that the browser property is valid.βœ… πŸ“¦
valid-bugsEnforce that the bugs property is valid.βœ… πŸ“¦
valid-bundleDependenciesEnforce that the bundleDependencies (also bundledDependencies) property is valid.βœ… πŸ“¦
valid-configEnforce that the config property is valid.βœ… πŸ“¦
valid-contributorsEnforce that the contributors property is valid.βœ… πŸ“¦
valid-cpuEnforce that the cpu property is valid.βœ… πŸ“¦
valid-dependenciesEnforce that the dependencies property is valid.βœ… πŸ“¦
valid-descriptionEnforce that the description property is valid.βœ… πŸ“¦
valid-devDependenciesEnforce that the devDependencies property is valid.βœ… πŸ“¦
valid-devEnginesEnforce that the devEngines property is valid.βœ… πŸ“¦
valid-directoriesEnforce that the directories property is valid.βœ… πŸ“¦
valid-enginesEnforce that the engines property is valid.βœ… πŸ“¦
valid-exportsEnforce that the exports property is valid.βœ… πŸ“¦
valid-filesEnforce that the files property is valid.βœ… πŸ“¦
valid-fundingEnforce that the funding property is valid.βœ… πŸ“¦
valid-gypfileEnforce that the gypfile property is valid.βœ… πŸ“¦
valid-homepageEnforce that the homepage property is valid.βœ… πŸ“¦
valid-keywordsEnforce that the keywords property is valid.βœ… πŸ“¦
valid-libcEnforce that the libc property is valid.βœ… πŸ“¦
valid-licenseEnforce that the license property is valid.βœ… πŸ“¦
valid-mainEnforce that the main property is valid.βœ… πŸ“¦
valid-manEnforce that the man property is valid.βœ… πŸ“¦
valid-moduleEnforce that the module property is valid.βœ… πŸ“¦
valid-nameEnforce that the name property is valid.βœ… πŸ“¦
valid-optionalDependenciesEnforce that the optionalDependencies property is valid.βœ… πŸ“¦
valid-osEnforce that the os property is valid.βœ… πŸ“¦
valid-packageManagerEnforce that the packageManager property is valid.βœ… πŸ“¦
valid-peerDependenciesEnforce that the peerDependencies property is valid.βœ… πŸ“¦
valid-peerDependenciesMetaEnforce that the peerDependenciesMeta property is valid.βœ… πŸ“¦
valid-peerDependenciesMeta-relationshipEnforces that any dependencies declared in peerDependenciesMeta are also defined in the package's peerDependencies.βœ… πŸ“¦πŸ’‘
valid-privateEnforce that the private property is valid.βœ… πŸ“¦
valid-publishConfigEnforce that the publishConfig property is valid.βœ… πŸ“¦
valid-repositoryEnforce that the repository property is valid.βœ… πŸ“¦
valid-repository-directoryEnforce that if repository directory is specified, it matches the path to the package.json fileβœ… πŸ“¦πŸ’‘
valid-scriptsEnforce that the scripts property is valid.βœ… πŸ“¦
valid-sideEffectsEnforce that the sideEffects property is valid.βœ… πŸ“¦
valid-typeEnforce that the type property is valid.βœ… πŸ“¦
valid-versionEnforce that the version property is valid.βœ… πŸ“¦
valid-workspacesEnforce that the workspaces property is valid.βœ… πŸ“¦

These rules only run on package.json files; they will ignore all other files being linted. They can lint package.json files at project root and in any subfolder of the project, making this plugin great for monorepos.

Deprecation Policy

We never want to remove things, when we're building them! But the reality is that libraries evolve and deprecations are a fact of life. Following are the different timeframes that we've defined as it relates to deprecating APIs in this project.

RFC Timeframe (6 weeks)

When some aspect of our API is going to be deprecated (and eventually removed), it must initially go through an RFC phase. Whoever's motivating the removal of the api, should create an RFC issue explaining the proposal and inviting feedback from the community. That RFC should remain active for at least 6 weeks. The RFC text should make clear what the target date is for closing the RFC. Once the RFC period is over, if the removal is still moving forward, the API(s) should be officially deprecated.

Removal Timeframe (6 months)

Once an API has been marked as deprecated, it will remain intact for at least 6 months. After 6 months from the date of deprecation, the API is subject to removal.

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md. Thanks! πŸ—‚

Contributors

Alan
Alan

πŸ› πŸ’»
AlexTheMan
AlexTheMan

πŸ€”
Andreas Lindberg
Andreas Lindberg

πŸ›
Andrew Kazakov
Andrew Kazakov

πŸ› πŸ’» πŸ€” πŸ”§
Anton Khitrenovich
Anton Khitrenovich

πŸ€”
Azat S.
Azat S.

πŸ€” πŸ’»
Brad Jorsch
Brad Jorsch

πŸ€” πŸ› πŸ’»
Christopher Buss
Christopher Buss

πŸ› πŸ€” πŸ’»
ClΓ©ment Valot
ClΓ©ment Valot

πŸ› πŸ’»
Curtis Jewell
Curtis Jewell

πŸ€”
David LJ
David LJ

πŸ“–
Eli
Eli

πŸ€” πŸ›
Flo Edelmann
Flo Edelmann

πŸ“–
Heggria
Heggria

πŸ€”
Hiroki Osame
Hiroki Osame

πŸ€” πŸ’»
Ivan Uhalin
Ivan Uhalin

πŸ€”
James
James

πŸ’» πŸ€” πŸ› πŸ“–
James Zetlen
James Zetlen

πŸ’» πŸ› πŸ“– πŸš‡ 🚧 πŸ”§
JesΓΊs LeganΓ©s-Combarro
JesΓΊs LeganΓ©s-Combarro

πŸ’»
Josh Goldberg ✨
Josh Goldberg ✨

πŸ”§ πŸ› πŸ’» πŸš‡ πŸ“– 🚧 πŸ€” πŸ–‹ πŸ“†
Kendall Gassner
Kendall Gassner

πŸ’» 🚧
Kristjan ESPERANTO
Kristjan ESPERANTO

πŸ€” πŸ› πŸ’»
Marco Pasqualetti
Marco Pasqualetti

πŸ’» πŸ”§ 🚧
Mathias Schreck
Mathias Schreck

πŸ€”
Michael
Michael "Mike" Ferris

πŸ’»
Morrison Cole
Morrison Cole

πŸ› πŸ“–
Nick Schonning
Nick Schonning

πŸ’»
Olivier Zalmanski
Olivier Zalmanski

🚧 πŸ“–
Patrik Csak
Patrik Csak

πŸ›
Pavel
Pavel

πŸ€” πŸ”§ πŸ“– πŸ’» πŸ›
Sasial
Sasial

πŸ’»
Sergey Belozyorcev
Sergey Belozyorcev

πŸ€”
Shayan Zamani
Shayan Zamani

πŸ€” πŸ“– πŸ’»
Sigmabro
Sigmabro

πŸ’»
Stephen
Stephen

πŸ’»
Stephen Zhou
Stephen Zhou

πŸ› πŸ’» πŸ€” πŸ“–
Yosuke Ota
Yosuke Ota

πŸ› πŸ’»
b3rnhard
b3rnhard

πŸ›
chouchouji
chouchouji

πŸ’»
michael faith
michael faith

πŸš‡ πŸ’» 🚧 πŸ€” πŸ› πŸ”§ πŸ“– πŸ“†
roottool
roottool

πŸ’»
sunnytsang1998
sunnytsang1998

πŸ›

License

See the LICENSE file for license rights and limitations (MIT).