Skip to content

Latest commit

ย 

History

History
257 lines (226 loc) ยท 48.5 KB

File metadata and controls

257 lines (226 loc) ยท 48.5 KB

Logo Image

ESLint Plugin: Package JSON

Rules for consistent, readable, and valid package.json files. ๐Ÿ—‚๏ธ

๐Ÿ‘ช All Contributors: 43 ๐Ÿงช 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-casing Enforce that names for bin properties are in kebab case. ๐ŸŽจ ๐Ÿ’ก
exports-subpaths-style Enforce consistent format for the exports field (implicit or explicit subpaths). ๐ŸŽจ ๐Ÿ”ง
no-empty-fields Reports on unnecessary empty arrays and objects. โœ… ๐Ÿ“ฆ ๐Ÿ’ก
no-local-dependencies Requires that dependencies do not use local file paths, which will likely result in errors when installing from a registry.
no-redundant-files Prevents adding unnecessary / redundant files. โœ… ๐Ÿ“ฆ ๐Ÿ’ก
no-redundant-publishConfig Warns when publishConfig.access is used in unscoped packages. โœ… ๐Ÿ“ฆ ๐Ÿ’ก
order-properties Enforces that package properties are declared in a consistent order. ๐ŸŽจ ๐Ÿ”ง
repository-shorthand Enforce either object or shorthand declaration for repository. โœ… ๐Ÿ“ฆ ๐Ÿ”ง
require-attribution Ensures 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. โœ… ๐Ÿ“ฆ ๐Ÿ’ก
restrict-dependency-ranges Restricts the range of dependencies to allow or disallow specific types of ranges. ๐Ÿ’ก
restrict-private-properties Disallows unnecessary properties in private packages. ๐Ÿ”ง ๐Ÿ’ก
restrict-top-level-properties Disallows specified top-level properties in package.json. ๐Ÿ’ก
scripts-name-casing Enforce that names for scripts are in kebab case (optionally separated by colons). ๐ŸŽจ ๐Ÿ’ก
sort-collections Selected collections must be in a consistent order (lexicographical for most; lifecycle-aware for scripts). โœ… ๐Ÿ“ฆ ๐Ÿ”ง
specify-peers-locally Requires that all peer dependencies are also declared as dev dependencies โœ… ๐Ÿ“ฆ ๐Ÿ’ก
unique-dependencies Checks a dependency isn't specified more than once (i.e. in dependencies and devDependencies) โœ… ๐Ÿ“ฆ ๐Ÿ’ก
valid-peerDependenciesMeta-relationship Enforces that any dependencies declared in peerDependenciesMeta are also defined in the package's peerDependencies. โœ… ๐Ÿ“ฆ ๐Ÿ’ก
valid-repository-directory Enforce that if repository directory is specified, it matches the path to the package.json file โœ… ๐Ÿ“ฆ ๐Ÿ’ก

Require Properties

This group of rules allows you to require that the associated top-level property must be present in the package.json.

Name Description ๐Ÿ’ผ ๐Ÿ”ง ๐Ÿ’ก
require-author Requires the author property to be present.
require-bin Requires the bin property to be present.
require-browser Requires the browser property to be present.
require-bugs Requires the bugs property to be present.
require-bundleDependencies Requires the bundleDependencies property to be present.
require-config Requires the config property to be present.
require-contributors Requires the contributors property to be present.
require-cpu Requires the cpu property to be present.
require-dependencies Requires the dependencies property to be present.
require-description Requires the description property to be present. โœ… ๐Ÿ“ฆ
require-devDependencies Requires the devDependencies property to be present.
require-devEngines Requires the devEngines property to be present.
require-directories Requires the directories property to be present.
require-engines Requires the engines property to be present.
require-exports Requires the exports property to be present. โœ… ๐Ÿ“ฆ
require-files Requires the files property to be present. โœ… ๐Ÿ“ฆ
require-funding Requires the funding property to be present.
require-gypfile Requires the gypfile property to be present.
require-homepage Requires the homepage property to be present.
require-keywords Requires the keywords property to be present.
require-libc Requires the libc property to be present.
require-license Requires the license property to be present. โœ… ๐Ÿ“ฆ
require-main Requires the main property to be present.
require-man Requires the man property to be present.
require-module Requires the module property to be present.
require-name Requires the name property to be present. โœ… ๐Ÿ“ฆ
require-optionalDependencies Requires the optionalDependencies property to be present.
require-os Requires the os property to be present.
require-packageManager Requires the packageManager property to be present.
require-peerDependencies Requires the peerDependencies property to be present.
require-peerDependenciesMeta Requires the peerDependenciesMeta property to be present.
require-private Requires the private property to be present. ๐Ÿ”ง
require-publishConfig Requires the publishConfig property to be present.
require-repository Requires the repository property to be present. โœ… ๐Ÿ“ฆ
require-scripts Requires the scripts property to be present.
require-sideEffects Requires the sideEffects property to be present. โœ… ๐Ÿ“ฆ
require-type Requires the type property to be present. โœ… ๐Ÿ“ฆ ๐Ÿ”ง
require-types Requires the types property to be present.
require-version Requires the version property to be present. โœ… ๐Ÿ“ฆ

Valid Properties

This group of rules allows you to enforce that the value of the associated top-level property is valid. All of these rules are include in the recommended config.

Nameย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย ย  Description ๐Ÿ’ผ ๐Ÿ”ง ๐Ÿ’ก
valid-author Enforce that the author property is valid. โœ… ๐Ÿ“ฆ
valid-bin Enforce that the bin property is valid. โœ… ๐Ÿ“ฆ
valid-browser Enforce that the browser property is valid. โœ… ๐Ÿ“ฆ
valid-bugs Enforce that the bugs property is valid. โœ… ๐Ÿ“ฆ
valid-bundleDependencies Enforce that the bundleDependencies (also bundledDependencies) property is valid. โœ… ๐Ÿ“ฆ
valid-config Enforce that the config property is valid. โœ… ๐Ÿ“ฆ
valid-contributors Enforce that the contributors property is valid. โœ… ๐Ÿ“ฆ
valid-cpu Enforce that the cpu property is valid. โœ… ๐Ÿ“ฆ
valid-dependencies Enforce that the dependencies property is valid. โœ… ๐Ÿ“ฆ
valid-description Enforce that the description property is valid. โœ… ๐Ÿ“ฆ
valid-devDependencies Enforce that the devDependencies property is valid. โœ… ๐Ÿ“ฆ
valid-devEngines Enforce that the devEngines property is valid. โœ… ๐Ÿ“ฆ
valid-directories Enforce that the directories property is valid. โœ… ๐Ÿ“ฆ
valid-engines Enforce that the engines property is valid. โœ… ๐Ÿ“ฆ
valid-exports Enforce that the exports property is valid. โœ… ๐Ÿ“ฆ
valid-files Enforce that the files property is valid. โœ… ๐Ÿ“ฆ
valid-funding Enforce that the funding property is valid. โœ… ๐Ÿ“ฆ
valid-gypfile Enforce that the gypfile property is valid. โœ… ๐Ÿ“ฆ
valid-homepage Enforce that the homepage property is valid. โœ… ๐Ÿ“ฆ
valid-keywords Enforce that the keywords property is valid. โœ… ๐Ÿ“ฆ
valid-libc Enforce that the libc property is valid. โœ… ๐Ÿ“ฆ
valid-license Enforce that the license property is valid. โœ… ๐Ÿ“ฆ
valid-main Enforce that the main property is valid. โœ… ๐Ÿ“ฆ
valid-man Enforce that the man property is valid. โœ… ๐Ÿ“ฆ
valid-module Enforce that the module property is valid. โœ… ๐Ÿ“ฆ
valid-name Enforce that the name property is valid. โœ… ๐Ÿ“ฆ
valid-optionalDependencies Enforce that the optionalDependencies property is valid. โœ… ๐Ÿ“ฆ
valid-os Enforce that the os property is valid. โœ… ๐Ÿ“ฆ
valid-packageManager Enforce that the packageManager property is valid. โœ… ๐Ÿ“ฆ
valid-peerDependencies Enforce that the peerDependencies property is valid. โœ… ๐Ÿ“ฆ
valid-peerDependenciesMeta Enforce that the peerDependenciesMeta property is valid. โœ… ๐Ÿ“ฆ
valid-private Enforce that the private property is valid. โœ… ๐Ÿ“ฆ
valid-publishConfig Enforce that the publishConfig property is valid. โœ… ๐Ÿ“ฆ
valid-repository Enforce that the repository property is valid. โœ… ๐Ÿ“ฆ
valid-scripts Enforce that the scripts property is valid. โœ… ๐Ÿ“ฆ
valid-sideEffects Enforce that the sideEffects property is valid. โœ… ๐Ÿ“ฆ
valid-type Enforce that the type property is valid. โœ… ๐Ÿ“ฆ
valid-version Enforce that the version property is valid. โœ… ๐Ÿ“ฆ
valid-workspaces Enforce 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

๐Ÿ› ๐Ÿ’ป ๐Ÿค” ๐Ÿ“–
Wes Todd
Wes Todd

๐Ÿค”
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).

โšก