require-keywords
This rule checks for the existence of the keywords property and reports a violation if it doesnât exist.
Examples
Section titled âExamplesâ{ "name": "thee-silver-mt-zion", "version": "13.0.0"}{ "name": "thee-silver-mt-zion", "version": "13.0.0", "keywords": ["eslint"]}Options
Section titled âOptionsâ| Name | Description | Type | Default |
|---|---|---|---|
ignorePrivate |
Determines if this rule should be enforced when the packageâs private property is true. |
Boolean | true |
{ "package-json/require-keywords": [ "error", { "ignorePrivate": false } ]}Examples
Section titled âExamplesâExample of incorrect code for this rule with the { "ignorePrivate": false } option:
{ "private": true}Examples of incorrect code for this rule with the { "ignorePrivate": true } option:
{ "private": false}{}Example of correct code for this rule with the { "ignorePrivate": false } option:
{ "private": true, "keywords": ["eslint"]}Example of correct code for this rule with the { "ignorePrivate": true } option:
{ "private": true}Related Rules
Section titled âRelated Rulesâvalid-keywords- Enforces that thekeywordsproperty is valid.