eslint-plugin-package-json 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -106
- package/{lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.d.mts → dist/createRule-29pC9RoP.d.mts} +49 -4
- package/dist/experimental/index.d.mts +68 -0
- package/{lib/experimental/plugin.mjs → dist/experimental/index.mjs} +10 -5
- package/dist/index.d.mts +99 -0
- package/{lib → dist}/index.mjs +1 -1
- package/dist/plugin-C-Z8sf5g.mjs +1737 -0
- package/package.json +33 -27
- package/lib/createRule.d.mts +0 -59
- package/lib/createRule.mjs +0 -24
- package/lib/experimental/index.d.mts +0 -34
- package/lib/experimental/index.mjs +0 -7
- package/lib/experimental/plugin.d.mts +0 -40
- package/lib/index.d.mts +0 -49
- package/lib/node_modules/.pnpm/@types_estree@1.0.8/node_modules/@types/estree/index.d.mts +0 -438
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/deserializationPattern.d.mts +0 -7
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/fromSchemaOptions.d.mts +0 -20
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/index.d.mts +0 -11
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-options.d.mts +0 -16
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/allOf.d.mts +0 -13
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/anyOf.d.mts +0 -14
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/array.d.mts +0 -58
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/const.d.mts +0 -14
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/deserialize.d.mts +0 -13
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/enum.d.mts +0 -14
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/ifThenElse.d.mts +0 -20
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/index.d.mts +0 -34
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/multipleTypes.d.mts +0 -14
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/not.d.mts +0 -20
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/nullable.d.mts +0 -14
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/object.d.mts +0 -34
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/oneOf.d.mts +0 -14
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/external.d.mts +0 -22
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/index.d.mts +0 -13
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/internal.d.mts +0 -8
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/utils.d.mts +0 -12
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/singleType.d.mts +0 -24
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/utils.d.mts +0 -20
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/and.d.mts +0 -4
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/extends.d.mts +0 -4
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/get.d.mts +0 -4
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/join.d.mts +0 -4
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/not.d.mts +0 -4
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/pop.d.mts +0 -4
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/split.d.mts +0 -7
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/tail.d.mts +0 -4
- package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/writable.d.mts +0 -4
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.d.mts +0 -20
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.d.mts +0 -28
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.d.mts +0 -25
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.d.mts +0 -25
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/any.d.mts +0 -16
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/array.d.mts +0 -20
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/const.d.mts +0 -28
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/enum.d.mts +0 -23
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.d.mts +0 -24
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/object.d.mts +0 -44
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/primitive.d.mts +0 -16
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/tuple.d.mts +0 -43
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/union.d.mts +0 -13
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/utils.d.mts +0 -35
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/any.d.mts +0 -23
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/array.d.mts +0 -24
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/const.d.mts +0 -34
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/enum.d.mts +0 -26
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.d.mts +0 -24
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/object.d.mts +0 -25
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/primitive.d.mts +0 -23
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/tuple.d.mts +0 -26
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/union.d.mts +0 -17
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/utils.d.mts +0 -10
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.d.mts +0 -9
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/object.d.mts +0 -49
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/primitive.d.mts +0 -26
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.d.mts +0 -22
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.d.mts +0 -36
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/type.d.mts +0 -18
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.d.mts +0 -23
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/utils.d.mts +0 -7
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/and.d.mts +0 -4
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/extends.d.mts +0 -7
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/if.d.mts +0 -4
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/intersectUnion.d.mts +0 -4
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/isNever.d.mts +0 -4
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/merge.d.mts +0 -6
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/not.d.mts +0 -4
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/or.d.mts +0 -4
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/prettify.d.mts +0 -6
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/tail.d.mts +0 -4
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionLast.d.mts +0 -6
- package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionPop.d.mts +0 -6
- package/lib/plugin.d.mts +0 -56
- package/lib/plugin.mjs +0 -93
- package/lib/rules/bin-name-casing.d.mts +0 -6
- package/lib/rules/bin-name-casing.mjs +0 -41
- package/lib/rules/exports-subpaths-style.d.mts +0 -18
- package/lib/rules/exports-subpaths-style.mjs +0 -71
- package/lib/rules/no-empty-fields.d.mts +0 -20
- package/lib/rules/no-empty-fields.mjs +0 -90
- package/lib/rules/no-local-dependencies.d.mts +0 -17
- package/lib/rules/no-local-dependencies.mjs +0 -47
- package/lib/rules/no-redundant-files.d.mts +0 -6
- package/lib/rules/no-redundant-files.mjs +0 -100
- package/lib/rules/no-redundant-publishConfig.d.mts +0 -6
- package/lib/rules/no-redundant-publishConfig.mjs +0 -50
- package/lib/rules/order-properties.d.mts +0 -25
- package/lib/rules/order-properties.mjs +0 -64
- package/lib/rules/repository-shorthand.d.mts +0 -18
- package/lib/rules/repository-shorthand.mjs +0 -111
- package/lib/rules/require-attribution.d.mts +0 -22
- package/lib/rules/require-attribution.mjs +0 -91
- package/lib/rules/require-properties.d.mts +0 -22
- package/lib/rules/require-properties.mjs +0 -74
- package/lib/rules/restrict-dependency-ranges.d.mts +0 -92
- package/lib/rules/restrict-dependency-ranges.mjs +0 -147
- package/lib/rules/restrict-private-properties.d.mts +0 -20
- package/lib/rules/restrict-private-properties.mjs +0 -53
- package/lib/rules/restrict-top-level-properties.d.mts +0 -39
- package/lib/rules/restrict-top-level-properties.mjs +0 -73
- package/lib/rules/scripts-name-casing.d.mts +0 -6
- package/lib/rules/scripts-name-casing.mjs +0 -44
- package/lib/rules/sort-collections.d.mts +0 -35
- package/lib/rules/sort-collections.mjs +0 -111
- package/lib/rules/specify-peers-locally.d.mts +0 -6
- package/lib/rules/specify-peers-locally.mjs +0 -63
- package/lib/rules/unique-dependencies.d.mts +0 -6
- package/lib/rules/unique-dependencies.mjs +0 -87
- package/lib/rules/valid-author.d.mts +0 -6
- package/lib/rules/valid-author.mjs +0 -59
- package/lib/rules/valid-peerDependenciesMeta-relationship.d.mts +0 -6
- package/lib/rules/valid-peerDependenciesMeta-relationship.mjs +0 -50
- package/lib/rules/valid-properties.d.mts +0 -9
- package/lib/rules/valid-properties.mjs +0 -57
- package/lib/rules/valid-repository-directory.d.mts +0 -6
- package/lib/rules/valid-repository-directory.mjs +0 -73
- package/lib/types/estree.d.mts +0 -8
- package/lib/utils/createSimpleRequirePropertyRule.d.mts +0 -48
- package/lib/utils/createSimpleRequirePropertyRule.mjs +0 -62
- package/lib/utils/createSimpleValidPropertyRule.d.mts +0 -17
- package/lib/utils/createSimpleValidPropertyRule.mjs +0 -57
- package/lib/utils/findPropertyWithKeyValue.d.mts +0 -10
- package/lib/utils/findPropertyWithKeyValue.mjs +0 -6
- package/lib/utils/formatErrors.d.mts +0 -9
- package/lib/utils/formatErrors.mjs +0 -12
- package/lib/utils/git/getGitAuthor.d.mts +0 -8
- package/lib/utils/git/getGitAuthor.mjs +0 -29
- package/lib/utils/git/index.d.mts +0 -2
- package/lib/utils/git/index.mjs +0 -2
- package/lib/utils/predicates/index.d.mts +0 -4
- package/lib/utils/predicates/index.mjs +0 -4
- package/lib/utils/predicates/isJSONStringLiteral.d.mts +0 -6
- package/lib/utils/predicates/isJSONStringLiteral.mjs +0 -6
- package/lib/utils/predicates/isNotNullish.d.mts +0 -4
- package/lib/utils/predicates/isNotNullish.mjs +0 -6
- package/lib/utils/predicates/isPackageJson.d.mts +0 -4
- package/lib/utils/predicates/isPackageJson.mjs +0 -4
package/README.md
CHANGED
|
@@ -33,123 +33,122 @@ See [Getting Started](https://eslint-plugin-package-json.dev/getting-started) fo
|
|
|
33
33
|
|
|
34
34
|
💼 Configurations enabled in.\
|
|
35
35
|
✅ Set in the `recommended` configuration.\
|
|
36
|
-
📦 Set in the `recommended-publishable` configuration.\
|
|
37
36
|
🎨 Set in the `stylistic` configuration.\
|
|
38
37
|
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
|
|
39
38
|
💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
|
|
40
39
|
|
|
41
|
-
| Name | Description | 💼
|
|
42
|
-
| :------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
-
| [bin-name-casing](https://eslint-plugin-package-json.dev/rules/bin-name-casing) | Enforce that names for bin properties are in kebab case. | 🎨
|
|
44
|
-
| [exports-subpaths-style](https://eslint-plugin-package-json.dev/rules/exports-subpaths-style) | Enforce consistent format for the exports field (implicit or explicit subpaths). | 🎨
|
|
45
|
-
| [no-empty-fields](https://eslint-plugin-package-json.dev/rules/no-empty-fields) | Reports on unnecessary empty arrays and objects. | ✅
|
|
46
|
-
| [no-local-dependencies](https://eslint-plugin-package-json.dev/rules/no-local-dependencies) | Requires that dependencies do not use local file paths, which will likely result in errors when installing from a registry. |
|
|
47
|
-
| [no-redundant-files](https://eslint-plugin-package-json.dev/rules/no-redundant-files) | Prevents adding unnecessary / redundant files. | ✅
|
|
48
|
-
| [no-redundant-publishConfig](https://eslint-plugin-package-json.dev/rules/no-redundant-publishConfig) | Warns when publishConfig.access is used in unscoped packages. | ✅
|
|
49
|
-
| [order-properties](https://eslint-plugin-package-json.dev/rules/order-properties) | Enforces that package properties are declared in a consistent order. | 🎨
|
|
50
|
-
| [repository-shorthand](https://eslint-plugin-package-json.dev/rules/repository-shorthand) | Enforce either object or shorthand declaration for repository. | ✅
|
|
51
|
-
| [require-attribution](https://eslint-plugin-package-json.dev/rules/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. | ✅
|
|
52
|
-
| [restrict-dependency-ranges](https://eslint-plugin-package-json.dev/rules/restrict-dependency-ranges) | Restricts the range of dependencies to allow or disallow specific types of ranges. |
|
|
53
|
-
| [restrict-private-properties](https://eslint-plugin-package-json.dev/rules/restrict-private-properties) | Disallows unnecessary properties in private packages. |
|
|
54
|
-
| [restrict-top-level-properties](https://eslint-plugin-package-json.dev/rules/restrict-top-level-properties) | Disallows specified top-level properties in package.json. |
|
|
55
|
-
| [scripts-name-casing](https://eslint-plugin-package-json.dev/rules/scripts-name-casing) | Enforce that names for `scripts` are in kebab case (optionally separated by colons). | 🎨
|
|
56
|
-
| [sort-collections](https://eslint-plugin-package-json.dev/rules/sort-collections) | Selected collections must be in a consistent order (lexicographical for most; lifecycle-aware for scripts). | ✅
|
|
57
|
-
| [specify-peers-locally](https://eslint-plugin-package-json.dev/rules/specify-peers-locally) | Requires that all peer dependencies are also declared as dev dependencies | ✅
|
|
58
|
-
| [unique-dependencies](https://eslint-plugin-package-json.dev/rules/unique-dependencies) | Checks a dependency isn't specified more than once (i.e. in `dependencies` and `devDependencies`) | ✅
|
|
59
|
-
| [valid-peerDependenciesMeta-relationship](https://eslint-plugin-package-json.dev/rules/valid-peerDependenciesMeta-relationship) | Enforces that any dependencies declared in `peerDependenciesMeta` are also defined in the package's `peerDependencies`. | ✅
|
|
60
|
-
| [valid-repository-directory](https://eslint-plugin-package-json.dev/rules/valid-repository-directory) | Enforce that if repository directory is specified, it matches the path to the package.json file | ✅
|
|
40
|
+
| Name | Description | 💼 | 🔧 | 💡 |
|
|
41
|
+
| :------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-- | :-- | :-- |
|
|
42
|
+
| [bin-name-casing](https://eslint-plugin-package-json.dev/rules/bin-name-casing) | Enforce that names for bin properties are in kebab case. | 🎨 | | 💡 |
|
|
43
|
+
| [exports-subpaths-style](https://eslint-plugin-package-json.dev/rules/exports-subpaths-style) | Enforce consistent format for the exports field (implicit or explicit subpaths). | 🎨 | 🔧 | |
|
|
44
|
+
| [no-empty-fields](https://eslint-plugin-package-json.dev/rules/no-empty-fields) | Reports on unnecessary empty arrays and objects. | ✅ | | 💡 |
|
|
45
|
+
| [no-local-dependencies](https://eslint-plugin-package-json.dev/rules/no-local-dependencies) | Requires that dependencies do not use local file paths, which will likely result in errors when installing from a registry. | | | |
|
|
46
|
+
| [no-redundant-files](https://eslint-plugin-package-json.dev/rules/no-redundant-files) | Prevents adding unnecessary / redundant files. | ✅ | | 💡 |
|
|
47
|
+
| [no-redundant-publishConfig](https://eslint-plugin-package-json.dev/rules/no-redundant-publishConfig) | Warns when publishConfig.access is used in unscoped packages. | ✅ | | 💡 |
|
|
48
|
+
| [order-properties](https://eslint-plugin-package-json.dev/rules/order-properties) | Enforces that package properties are declared in a consistent order. | 🎨 | 🔧 | |
|
|
49
|
+
| [repository-shorthand](https://eslint-plugin-package-json.dev/rules/repository-shorthand) | Enforce either object or shorthand declaration for repository. | ✅ | 🔧 | |
|
|
50
|
+
| [require-attribution](https://eslint-plugin-package-json.dev/rules/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. | ✅ | | 💡 |
|
|
51
|
+
| [restrict-dependency-ranges](https://eslint-plugin-package-json.dev/rules/restrict-dependency-ranges) | Restricts the range of dependencies to allow or disallow specific types of ranges. | | | 💡 |
|
|
52
|
+
| [restrict-private-properties](https://eslint-plugin-package-json.dev/rules/restrict-private-properties) | Disallows unnecessary properties in private packages. | | 🔧 | 💡 |
|
|
53
|
+
| [restrict-top-level-properties](https://eslint-plugin-package-json.dev/rules/restrict-top-level-properties) | Disallows specified top-level properties in package.json. | | | 💡 |
|
|
54
|
+
| [scripts-name-casing](https://eslint-plugin-package-json.dev/rules/scripts-name-casing) | Enforce that names for `scripts` are in kebab case (optionally separated by colons). | 🎨 | | 💡 |
|
|
55
|
+
| [sort-collections](https://eslint-plugin-package-json.dev/rules/sort-collections) | Selected collections must be in a consistent order (lexicographical for most; lifecycle-aware for scripts). | ✅ | 🔧 | |
|
|
56
|
+
| [specify-peers-locally](https://eslint-plugin-package-json.dev/rules/specify-peers-locally) | Requires that all peer dependencies are also declared as dev dependencies | ✅ | | 💡 |
|
|
57
|
+
| [unique-dependencies](https://eslint-plugin-package-json.dev/rules/unique-dependencies) | Checks a dependency isn't specified more than once (i.e. in `dependencies` and `devDependencies`) | ✅ | | 💡 |
|
|
58
|
+
| [valid-peerDependenciesMeta-relationship](https://eslint-plugin-package-json.dev/rules/valid-peerDependenciesMeta-relationship) | Enforces that any dependencies declared in `peerDependenciesMeta` are also defined in the package's `peerDependencies`. | ✅ | | 💡 |
|
|
59
|
+
| [valid-repository-directory](https://eslint-plugin-package-json.dev/rules/valid-repository-directory) | Enforce that if repository directory is specified, it matches the path to the package.json file | ✅ | | 💡 |
|
|
61
60
|
|
|
62
61
|
### Require Properties
|
|
63
62
|
|
|
64
63
|
This group of rules allows you to require that the associated top-level property must be present in the `package.json`.
|
|
65
64
|
|
|
66
|
-
| Name | Description | 💼
|
|
67
|
-
| :--------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- |
|
|
68
|
-
| [require-author](https://eslint-plugin-package-json.dev/rules/require-properties/require-author) | Requires the `author` property to be present. |
|
|
69
|
-
| [require-bin](https://eslint-plugin-package-json.dev/rules/require-properties/require-bin) | Requires the `bin` property to be present. |
|
|
70
|
-
| [require-browser](https://eslint-plugin-package-json.dev/rules/require-properties/require-browser) | Requires the `browser` property to be present. |
|
|
71
|
-
| [require-bugs](https://eslint-plugin-package-json.dev/rules/require-properties/require-bugs) | Requires the `bugs` property to be present. |
|
|
72
|
-
| [require-bundleDependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-bundleDependencies) | Requires the `bundleDependencies` property to be present. |
|
|
73
|
-
| [require-config](https://eslint-plugin-package-json.dev/rules/require-properties/require-config) | Requires the `config` property to be present. |
|
|
74
|
-
| [require-contributors](https://eslint-plugin-package-json.dev/rules/require-properties/require-contributors) | Requires the `contributors` property to be present. |
|
|
75
|
-
| [require-cpu](https://eslint-plugin-package-json.dev/rules/require-properties/require-cpu) | Requires the `cpu` property to be present. |
|
|
76
|
-
| [require-dependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-dependencies) | Requires the `dependencies` property to be present. |
|
|
77
|
-
| [require-description](https://eslint-plugin-package-json.dev/rules/require-properties/require-description) | Requires the `description` property to be present. | ✅
|
|
78
|
-
| [require-devDependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-devDependencies) | Requires the `devDependencies` property to be present. |
|
|
79
|
-
| [require-devEngines](https://eslint-plugin-package-json.dev/rules/require-properties/require-devEngines) | Requires the `devEngines` property to be present. |
|
|
80
|
-
| [require-directories](https://eslint-plugin-package-json.dev/rules/require-properties/require-directories) | Requires the `directories` property to be present. |
|
|
81
|
-
| [require-engines](https://eslint-plugin-package-json.dev/rules/require-properties/require-engines) | Requires the `engines` property to be present. |
|
|
82
|
-
| [require-exports](https://eslint-plugin-package-json.dev/rules/require-properties/require-exports) | Requires the `exports` property to be present. | ✅
|
|
83
|
-
| [require-files](https://eslint-plugin-package-json.dev/rules/require-properties/require-files) | Requires the `files` property to be present. | ✅
|
|
84
|
-
| [require-funding](https://eslint-plugin-package-json.dev/rules/require-properties/require-funding) | Requires the `funding` property to be present. |
|
|
85
|
-
| [require-gypfile](https://eslint-plugin-package-json.dev/rules/require-properties/require-gypfile) | Requires the `gypfile` property to be present. |
|
|
86
|
-
| [require-homepage](https://eslint-plugin-package-json.dev/rules/require-properties/require-homepage) | Requires the `homepage` property to be present. |
|
|
87
|
-
| [require-keywords](https://eslint-plugin-package-json.dev/rules/require-properties/require-keywords) | Requires the `keywords` property to be present. |
|
|
88
|
-
| [require-libc](https://eslint-plugin-package-json.dev/rules/require-properties/require-libc) | Requires the `libc` property to be present. |
|
|
89
|
-
| [require-license](https://eslint-plugin-package-json.dev/rules/require-properties/require-license) | Requires the `license` property to be present. | ✅
|
|
90
|
-
| [require-main](https://eslint-plugin-package-json.dev/rules/require-properties/require-main) | Requires the `main` property to be present. |
|
|
91
|
-
| [require-man](https://eslint-plugin-package-json.dev/rules/require-properties/require-man) | Requires the `man` property to be present. |
|
|
92
|
-
| [require-module](https://eslint-plugin-package-json.dev/rules/require-properties/require-module) | Requires the `module` property to be present. |
|
|
93
|
-
| [require-name](https://eslint-plugin-package-json.dev/rules/require-properties/require-name) | Requires the `name` property to be present. | ✅
|
|
94
|
-
| [require-optionalDependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-optionalDependencies) | Requires the `optionalDependencies` property to be present. |
|
|
95
|
-
| [require-os](https://eslint-plugin-package-json.dev/rules/require-properties/require-os) | Requires the `os` property to be present. |
|
|
96
|
-
| [require-packageManager](https://eslint-plugin-package-json.dev/rules/require-properties/require-packageManager) | Requires the `packageManager` property to be present. |
|
|
97
|
-
| [require-peerDependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-peerDependencies) | Requires the `peerDependencies` property to be present. |
|
|
98
|
-
| [require-peerDependenciesMeta](https://eslint-plugin-package-json.dev/rules/require-properties/require-peerDependenciesMeta) | Requires the `peerDependenciesMeta` property to be present. |
|
|
99
|
-
| [require-private](https://eslint-plugin-package-json.dev/rules/require-properties/require-private) | Requires the `private` property to be present. |
|
|
100
|
-
| [require-publishConfig](https://eslint-plugin-package-json.dev/rules/require-properties/require-publishConfig) | Requires the `publishConfig` property to be present. |
|
|
101
|
-
| [require-repository](https://eslint-plugin-package-json.dev/rules/require-properties/require-repository) | Requires the `repository` property to be present. | ✅
|
|
102
|
-
| [require-scripts](https://eslint-plugin-package-json.dev/rules/require-properties/require-scripts) | Requires the `scripts` property to be present. |
|
|
103
|
-
| [require-sideEffects](https://eslint-plugin-package-json.dev/rules/require-properties/require-sideEffects) | Requires the `sideEffects` property to be present. | ✅
|
|
104
|
-
| [require-type](https://eslint-plugin-package-json.dev/rules/require-properties/require-type) | Requires the `type` property to be present. | ✅
|
|
105
|
-
| [require-types](https://eslint-plugin-package-json.dev/rules/require-properties/require-types) | Requires the `types` property to be present. |
|
|
106
|
-
| [require-version](https://eslint-plugin-package-json.dev/rules/require-properties/require-version) | Requires the `version` property to be present. | ✅
|
|
65
|
+
| Name | Description | 💼 | 🔧 | 💡 |
|
|
66
|
+
| :--------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------- | :-- | :-- | :-- |
|
|
67
|
+
| [require-author](https://eslint-plugin-package-json.dev/rules/require-properties/require-author) | Requires the `author` property to be present. | | 🔧 | |
|
|
68
|
+
| [require-bin](https://eslint-plugin-package-json.dev/rules/require-properties/require-bin) | Requires the `bin` property to be present. | | | |
|
|
69
|
+
| [require-browser](https://eslint-plugin-package-json.dev/rules/require-properties/require-browser) | Requires the `browser` property to be present. | | | |
|
|
70
|
+
| [require-bugs](https://eslint-plugin-package-json.dev/rules/require-properties/require-bugs) | Requires the `bugs` property to be present. | | | |
|
|
71
|
+
| [require-bundleDependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-bundleDependencies) | Requires the `bundleDependencies` property to be present. | | | |
|
|
72
|
+
| [require-config](https://eslint-plugin-package-json.dev/rules/require-properties/require-config) | Requires the `config` property to be present. | | | |
|
|
73
|
+
| [require-contributors](https://eslint-plugin-package-json.dev/rules/require-properties/require-contributors) | Requires the `contributors` property to be present. | | | |
|
|
74
|
+
| [require-cpu](https://eslint-plugin-package-json.dev/rules/require-properties/require-cpu) | Requires the `cpu` property to be present. | | | |
|
|
75
|
+
| [require-dependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-dependencies) | Requires the `dependencies` property to be present. | | | |
|
|
76
|
+
| [require-description](https://eslint-plugin-package-json.dev/rules/require-properties/require-description) | Requires the `description` property to be present. | ✅ | | |
|
|
77
|
+
| [require-devDependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-devDependencies) | Requires the `devDependencies` property to be present. | | | |
|
|
78
|
+
| [require-devEngines](https://eslint-plugin-package-json.dev/rules/require-properties/require-devEngines) | Requires the `devEngines` property to be present. | | | |
|
|
79
|
+
| [require-directories](https://eslint-plugin-package-json.dev/rules/require-properties/require-directories) | Requires the `directories` property to be present. | | | |
|
|
80
|
+
| [require-engines](https://eslint-plugin-package-json.dev/rules/require-properties/require-engines) | Requires the `engines` property to be present. | | | |
|
|
81
|
+
| [require-exports](https://eslint-plugin-package-json.dev/rules/require-properties/require-exports) | Requires the `exports` property to be present. | ✅ | | |
|
|
82
|
+
| [require-files](https://eslint-plugin-package-json.dev/rules/require-properties/require-files) | Requires the `files` property to be present. | ✅ | | |
|
|
83
|
+
| [require-funding](https://eslint-plugin-package-json.dev/rules/require-properties/require-funding) | Requires the `funding` property to be present. | | | |
|
|
84
|
+
| [require-gypfile](https://eslint-plugin-package-json.dev/rules/require-properties/require-gypfile) | Requires the `gypfile` property to be present. | | | |
|
|
85
|
+
| [require-homepage](https://eslint-plugin-package-json.dev/rules/require-properties/require-homepage) | Requires the `homepage` property to be present. | | | |
|
|
86
|
+
| [require-keywords](https://eslint-plugin-package-json.dev/rules/require-properties/require-keywords) | Requires the `keywords` property to be present. | | | |
|
|
87
|
+
| [require-libc](https://eslint-plugin-package-json.dev/rules/require-properties/require-libc) | Requires the `libc` property to be present. | | | |
|
|
88
|
+
| [require-license](https://eslint-plugin-package-json.dev/rules/require-properties/require-license) | Requires the `license` property to be present. | ✅ | | |
|
|
89
|
+
| [require-main](https://eslint-plugin-package-json.dev/rules/require-properties/require-main) | Requires the `main` property to be present. | | | |
|
|
90
|
+
| [require-man](https://eslint-plugin-package-json.dev/rules/require-properties/require-man) | Requires the `man` property to be present. | | | |
|
|
91
|
+
| [require-module](https://eslint-plugin-package-json.dev/rules/require-properties/require-module) | Requires the `module` property to be present. | | | |
|
|
92
|
+
| [require-name](https://eslint-plugin-package-json.dev/rules/require-properties/require-name) | Requires the `name` property to be present. | ✅ | | |
|
|
93
|
+
| [require-optionalDependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-optionalDependencies) | Requires the `optionalDependencies` property to be present. | | | |
|
|
94
|
+
| [require-os](https://eslint-plugin-package-json.dev/rules/require-properties/require-os) | Requires the `os` property to be present. | | | |
|
|
95
|
+
| [require-packageManager](https://eslint-plugin-package-json.dev/rules/require-properties/require-packageManager) | Requires the `packageManager` property to be present. | | | |
|
|
96
|
+
| [require-peerDependencies](https://eslint-plugin-package-json.dev/rules/require-properties/require-peerDependencies) | Requires the `peerDependencies` property to be present. | | | |
|
|
97
|
+
| [require-peerDependenciesMeta](https://eslint-plugin-package-json.dev/rules/require-properties/require-peerDependenciesMeta) | Requires the `peerDependenciesMeta` property to be present. | | | |
|
|
98
|
+
| [require-private](https://eslint-plugin-package-json.dev/rules/require-properties/require-private) | Requires the `private` property to be present. | | 🔧 | |
|
|
99
|
+
| [require-publishConfig](https://eslint-plugin-package-json.dev/rules/require-properties/require-publishConfig) | Requires the `publishConfig` property to be present. | | | |
|
|
100
|
+
| [require-repository](https://eslint-plugin-package-json.dev/rules/require-properties/require-repository) | Requires the `repository` property to be present. | ✅ | | |
|
|
101
|
+
| [require-scripts](https://eslint-plugin-package-json.dev/rules/require-properties/require-scripts) | Requires the `scripts` property to be present. | | | |
|
|
102
|
+
| [require-sideEffects](https://eslint-plugin-package-json.dev/rules/require-properties/require-sideEffects) | Requires the `sideEffects` property to be present. | ✅ | | |
|
|
103
|
+
| [require-type](https://eslint-plugin-package-json.dev/rules/require-properties/require-type) | Requires the `type` property to be present. | ✅ | 🔧 | |
|
|
104
|
+
| [require-types](https://eslint-plugin-package-json.dev/rules/require-properties/require-types) | Requires the `types` property to be present. | | | |
|
|
105
|
+
| [require-version](https://eslint-plugin-package-json.dev/rules/require-properties/require-version) | Requires the `version` property to be present. | ✅ | | |
|
|
107
106
|
|
|
108
107
|
### Valid Properties
|
|
109
108
|
|
|
110
109
|
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.
|
|
111
110
|
|
|
112
|
-
| Name | Description | 💼
|
|
113
|
-
| :--------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------ |
|
|
114
|
-
| [valid-author](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-author) | Enforce that the `author` property is valid. | ✅
|
|
115
|
-
| [valid-bin](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-bin) | Enforce that the `bin` property is valid. | ✅
|
|
116
|
-
| [valid-browser](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-browser) | Enforce that the `browser` property is valid. | ✅
|
|
117
|
-
| [valid-bugs](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-bugs) | Enforce that the `bugs` property is valid. | ✅
|
|
118
|
-
| [valid-bundleDependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-bundleDependencies) | Enforce that the `bundleDependencies` (also `bundledDependencies`) property is valid. | ✅
|
|
119
|
-
| [valid-config](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-config) | Enforce that the `config` property is valid. | ✅
|
|
120
|
-
| [valid-contributors](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-contributors) | Enforce that the `contributors` property is valid. | ✅
|
|
121
|
-
| [valid-cpu](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-cpu) | Enforce that the `cpu` property is valid. | ✅
|
|
122
|
-
| [valid-dependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-dependencies) | Enforce that the `dependencies` property is valid. | ✅
|
|
123
|
-
| [valid-description](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-description) | Enforce that the `description` property is valid. | ✅
|
|
124
|
-
| [valid-devDependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-devDependencies) | Enforce that the `devDependencies` property is valid. | ✅
|
|
125
|
-
| [valid-devEngines](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-devEngines) | Enforce that the `devEngines` property is valid. | ✅
|
|
126
|
-
| [valid-directories](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-directories) | Enforce that the `directories` property is valid. | ✅
|
|
127
|
-
| [valid-engines](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-engines) | Enforce that the `engines` property is valid. | ✅
|
|
128
|
-
| [valid-exports](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-exports) | Enforce that the `exports` property is valid. | ✅
|
|
129
|
-
| [valid-files](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-files) | Enforce that the `files` property is valid. | ✅
|
|
130
|
-
| [valid-funding](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-funding) | Enforce that the `funding` property is valid. | ✅
|
|
131
|
-
| [valid-gypfile](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-gypfile) | Enforce that the `gypfile` property is valid. | ✅
|
|
132
|
-
| [valid-homepage](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-homepage) | Enforce that the `homepage` property is valid. | ✅
|
|
133
|
-
| [valid-keywords](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-keywords) | Enforce that the `keywords` property is valid. | ✅
|
|
134
|
-
| [valid-libc](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-libc) | Enforce that the `libc` property is valid. | ✅
|
|
135
|
-
| [valid-license](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-license) | Enforce that the `license` property is valid. | ✅
|
|
136
|
-
| [valid-main](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-main) | Enforce that the `main` property is valid. | ✅
|
|
137
|
-
| [valid-man](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-man) | Enforce that the `man` property is valid. | ✅
|
|
138
|
-
| [valid-module](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-module) | Enforce that the `module` property is valid. | ✅
|
|
139
|
-
| [valid-name](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-name) | Enforce that the `name` property is valid. | ✅
|
|
140
|
-
| [valid-optionalDependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-optionalDependencies) | Enforce that the `optionalDependencies` property is valid. | ✅
|
|
141
|
-
| [valid-os](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-os) | Enforce that the `os` property is valid. | ✅
|
|
142
|
-
| [valid-packageManager](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-packageManager) | Enforce that the `packageManager` property is valid. | ✅
|
|
143
|
-
| [valid-peerDependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-peerDependencies) | Enforce that the `peerDependencies` property is valid. | ✅
|
|
144
|
-
| [valid-peerDependenciesMeta](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-peerDependenciesMeta) | Enforce that the `peerDependenciesMeta` property is valid. | ✅
|
|
145
|
-
| [valid-private](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-private) | Enforce that the `private` property is valid. | ✅
|
|
146
|
-
| [valid-publishConfig](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-publishConfig) | Enforce that the `publishConfig` property is valid. | ✅
|
|
147
|
-
| [valid-repository](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-repository) | Enforce that the `repository` property is valid. | ✅
|
|
148
|
-
| [valid-scripts](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-scripts) | Enforce that the `scripts` property is valid. | ✅
|
|
149
|
-
| [valid-sideEffects](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-sideEffects) | Enforce that the `sideEffects` property is valid. | ✅
|
|
150
|
-
| [valid-type](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-type) | Enforce that the `type` property is valid. | ✅
|
|
151
|
-
| [valid-version](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-version) | Enforce that the `version` property is valid. | ✅
|
|
152
|
-
| [valid-workspaces](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-workspaces) | Enforce that the `workspaces` property is valid. | ✅
|
|
111
|
+
| Name | Description | 💼 | 🔧 | 💡 |
|
|
112
|
+
| :--------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------ | :-- | :-- | :-- |
|
|
113
|
+
| [valid-author](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-author) | Enforce that the `author` property is valid. | ✅ | 🔧 | |
|
|
114
|
+
| [valid-bin](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-bin) | Enforce that the `bin` property is valid. | ✅ | | |
|
|
115
|
+
| [valid-browser](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-browser) | Enforce that the `browser` property is valid. | ✅ | | |
|
|
116
|
+
| [valid-bugs](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-bugs) | Enforce that the `bugs` property is valid. | ✅ | | |
|
|
117
|
+
| [valid-bundleDependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-bundleDependencies) | Enforce that the `bundleDependencies` (also `bundledDependencies`) property is valid. | ✅ | | |
|
|
118
|
+
| [valid-config](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-config) | Enforce that the `config` property is valid. | ✅ | | |
|
|
119
|
+
| [valid-contributors](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-contributors) | Enforce that the `contributors` property is valid. | ✅ | | |
|
|
120
|
+
| [valid-cpu](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-cpu) | Enforce that the `cpu` property is valid. | ✅ | | |
|
|
121
|
+
| [valid-dependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-dependencies) | Enforce that the `dependencies` property is valid. | ✅ | | |
|
|
122
|
+
| [valid-description](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-description) | Enforce that the `description` property is valid. | ✅ | | |
|
|
123
|
+
| [valid-devDependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-devDependencies) | Enforce that the `devDependencies` property is valid. | ✅ | | |
|
|
124
|
+
| [valid-devEngines](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-devEngines) | Enforce that the `devEngines` property is valid. | ✅ | | |
|
|
125
|
+
| [valid-directories](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-directories) | Enforce that the `directories` property is valid. | ✅ | | |
|
|
126
|
+
| [valid-engines](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-engines) | Enforce that the `engines` property is valid. | ✅ | | |
|
|
127
|
+
| [valid-exports](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-exports) | Enforce that the `exports` property is valid. | ✅ | | |
|
|
128
|
+
| [valid-files](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-files) | Enforce that the `files` property is valid. | ✅ | | |
|
|
129
|
+
| [valid-funding](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-funding) | Enforce that the `funding` property is valid. | ✅ | | |
|
|
130
|
+
| [valid-gypfile](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-gypfile) | Enforce that the `gypfile` property is valid. | ✅ | | |
|
|
131
|
+
| [valid-homepage](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-homepage) | Enforce that the `homepage` property is valid. | ✅ | | |
|
|
132
|
+
| [valid-keywords](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-keywords) | Enforce that the `keywords` property is valid. | ✅ | | |
|
|
133
|
+
| [valid-libc](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-libc) | Enforce that the `libc` property is valid. | ✅ | | |
|
|
134
|
+
| [valid-license](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-license) | Enforce that the `license` property is valid. | ✅ | | |
|
|
135
|
+
| [valid-main](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-main) | Enforce that the `main` property is valid. | ✅ | | |
|
|
136
|
+
| [valid-man](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-man) | Enforce that the `man` property is valid. | ✅ | | |
|
|
137
|
+
| [valid-module](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-module) | Enforce that the `module` property is valid. | ✅ | | |
|
|
138
|
+
| [valid-name](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-name) | Enforce that the `name` property is valid. | ✅ | | |
|
|
139
|
+
| [valid-optionalDependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-optionalDependencies) | Enforce that the `optionalDependencies` property is valid. | ✅ | | |
|
|
140
|
+
| [valid-os](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-os) | Enforce that the `os` property is valid. | ✅ | | |
|
|
141
|
+
| [valid-packageManager](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-packageManager) | Enforce that the `packageManager` property is valid. | ✅ | | |
|
|
142
|
+
| [valid-peerDependencies](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-peerDependencies) | Enforce that the `peerDependencies` property is valid. | ✅ | | |
|
|
143
|
+
| [valid-peerDependenciesMeta](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-peerDependenciesMeta) | Enforce that the `peerDependenciesMeta` property is valid. | ✅ | | |
|
|
144
|
+
| [valid-private](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-private) | Enforce that the `private` property is valid. | ✅ | | |
|
|
145
|
+
| [valid-publishConfig](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-publishConfig) | Enforce that the `publishConfig` property is valid. | ✅ | | |
|
|
146
|
+
| [valid-repository](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-repository) | Enforce that the `repository` property is valid. | ✅ | | |
|
|
147
|
+
| [valid-scripts](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-scripts) | Enforce that the `scripts` property is valid. | ✅ | | |
|
|
148
|
+
| [valid-sideEffects](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-sideEffects) | Enforce that the `sideEffects` property is valid. | ✅ | | |
|
|
149
|
+
| [valid-type](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-type) | Enforce that the `type` property is valid. | ✅ | | |
|
|
150
|
+
| [valid-version](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-version) | Enforce that the `version` property is valid. | ✅ | | |
|
|
151
|
+
| [valid-workspaces](https://eslint-plugin-package-json.dev/rules/valid-properties/valid-workspaces) | Enforce that the `workspaces` property is valid. | ✅ | | |
|
|
153
152
|
|
|
154
153
|
<!-- end auto-generated rules list -->
|
|
155
154
|
|
|
@@ -175,10 +174,12 @@ Once the RFC period is over, if the removal is still moving forward, the API(s)
|
|
|
175
174
|
Once an API has been marked as deprecated, it will remain intact for at least 6 months.
|
|
176
175
|
After 6 months from the date of deprecation, the API is subject to removal.
|
|
177
176
|
|
|
178
|
-
##
|
|
177
|
+
## Getting Involved
|
|
179
178
|
|
|
180
|
-
See [
|
|
181
|
-
|
|
179
|
+
See [Contributing](https://eslint-plugin-package-json.dev/getting-involved/contributing/), then [Development](https://eslint-plugin-package-json.dev/getting-involved/development/).
|
|
180
|
+
If you're planning to contribute with AI tooling, please also read our [AI Contribution Policy](https://eslint-plugin-package-json.dev/getting-involved/contributing-with-ai/).
|
|
181
|
+
|
|
182
|
+
Thanks! 🍻
|
|
182
183
|
|
|
183
184
|
## Contributors
|
|
184
185
|
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { AST, RuleListener } from "jsonc-eslint-parser";
|
|
2
|
+
import { AST as AST$1, Rule, SourceCode } from "eslint";
|
|
3
|
+
import * as ESTree from "estree";
|
|
4
|
+
|
|
1
5
|
//#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.d.ts
|
|
2
6
|
declare const $JSONSchema: unique symbol;
|
|
3
7
|
type $JSONSchema = typeof $JSONSchema;
|
|
@@ -53,8 +57,49 @@ type JSONSchema = boolean | Readonly<{
|
|
|
53
57
|
examples?: readonly unknown[];
|
|
54
58
|
nullable?: boolean;
|
|
55
59
|
}>;
|
|
56
|
-
type JSONSchemaReference = JSONSchema & Readonly<{
|
|
57
|
-
$id: string;
|
|
58
|
-
}>;
|
|
59
60
|
//#endregion
|
|
60
|
-
|
|
61
|
+
//#region src/createRule.d.ts
|
|
62
|
+
type ASTBodyExpression = ESTree.Expression & {
|
|
63
|
+
properties: ASTBodyProperty[];
|
|
64
|
+
};
|
|
65
|
+
type ASTBodyProperty = AST.JSONProperty & {
|
|
66
|
+
value: string;
|
|
67
|
+
};
|
|
68
|
+
interface ASTBodyStatement extends ESTree.ExpressionStatement {
|
|
69
|
+
expression: ASTBodyExpression;
|
|
70
|
+
}
|
|
71
|
+
interface PackageAST extends AST$1.Program {
|
|
72
|
+
body: [ASTBodyStatement];
|
|
73
|
+
}
|
|
74
|
+
interface PackageJsonPluginSettings {
|
|
75
|
+
/**
|
|
76
|
+
* Whether `require-*` rules, if used, should enforce the presence of
|
|
77
|
+
* the corresponding property *in package.json files with `"private": true`*.
|
|
78
|
+
*
|
|
79
|
+
* If not specified, it will not enforce the presence only of `name` and `version` properties.
|
|
80
|
+
*/
|
|
81
|
+
enforceForPrivate?: boolean;
|
|
82
|
+
}
|
|
83
|
+
interface PackageJsonRuleContext<Options extends unknown[] = unknown[]> extends Rule.RuleContext {
|
|
84
|
+
options: Options;
|
|
85
|
+
settings: {
|
|
86
|
+
packageJson?: PackageJsonPluginSettings;
|
|
87
|
+
};
|
|
88
|
+
sourceCode: PackageJsonSourceCode;
|
|
89
|
+
}
|
|
90
|
+
interface PackageJsonRuleModule<Options extends unknown[] = unknown[], Schema extends JSONSchema[] = JSONSchema[]> {
|
|
91
|
+
create(context: PackageJsonRuleContext<Options>): RuleListener;
|
|
92
|
+
meta: Omit<Rule.RuleMetaData, 'defaultOptions' | 'docs' | 'schema'> & {
|
|
93
|
+
defaultOptions?: NoInfer<Options>;
|
|
94
|
+
docs?: Rule.RuleMetaData['docs'] & {
|
|
95
|
+
category?: string; /** An optional route segment to group this rule under */
|
|
96
|
+
ruleGroup?: string;
|
|
97
|
+
};
|
|
98
|
+
schema?: Schema;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
interface PackageJsonSourceCode extends SourceCode {
|
|
102
|
+
ast: PackageAST;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { PackageJsonRuleModule as n, JSONSchema as r, PackageJsonPluginSettings as t };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { n as PackageJsonRuleModule, r as JSONSchema, t as PackageJsonPluginSettings } from "../createRule-29pC9RoP.mjs";
|
|
2
|
+
import { ESLint } from "eslint";
|
|
3
|
+
|
|
4
|
+
//#region src/experimental/plugin.d.ts
|
|
5
|
+
declare const plugin: {
|
|
6
|
+
configs: {
|
|
7
|
+
recommended: {
|
|
8
|
+
files: string[];
|
|
9
|
+
language: string;
|
|
10
|
+
name: string;
|
|
11
|
+
plugins: {
|
|
12
|
+
readonly 'package-json': ESLint.Plugin;
|
|
13
|
+
};
|
|
14
|
+
rules: {
|
|
15
|
+
[k: string]: "error";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
stylistic: {
|
|
19
|
+
files: string[];
|
|
20
|
+
language: string;
|
|
21
|
+
name: string;
|
|
22
|
+
plugins: {
|
|
23
|
+
readonly 'package-json': ESLint.Plugin;
|
|
24
|
+
};
|
|
25
|
+
rules: {
|
|
26
|
+
[k: string]: "error";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
meta: {
|
|
31
|
+
name: string;
|
|
32
|
+
version: string;
|
|
33
|
+
};
|
|
34
|
+
rules: {
|
|
35
|
+
[k: string]: PackageJsonRuleModule<unknown[], JSONSchema[]>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/experimental/index.d.ts
|
|
40
|
+
declare const configs: {
|
|
41
|
+
recommended: {
|
|
42
|
+
files: string[];
|
|
43
|
+
language: string;
|
|
44
|
+
name: string;
|
|
45
|
+
plugins: {
|
|
46
|
+
readonly 'package-json': import("eslint").ESLint.Plugin;
|
|
47
|
+
};
|
|
48
|
+
rules: {
|
|
49
|
+
[k: string]: "error";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
stylistic: {
|
|
53
|
+
files: string[];
|
|
54
|
+
language: string;
|
|
55
|
+
name: string;
|
|
56
|
+
plugins: {
|
|
57
|
+
readonly 'package-json': import("eslint").ESLint.Plugin;
|
|
58
|
+
};
|
|
59
|
+
rules: {
|
|
60
|
+
[k: string]: "error";
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
declare const rules: {
|
|
65
|
+
[k: string]: PackageJsonRuleModule<unknown[], JSONSchema[]>;
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
export { type PackageJsonPluginSettings, configs, plugin as default, rules };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as plugin$1 } from "../plugin-C-Z8sf5g.mjs";
|
|
2
2
|
import { toCompatRule } from "eslint-json-compat-utils";
|
|
3
3
|
//#region src/experimental/plugin.ts
|
|
4
4
|
const language = "json/json";
|
|
5
|
-
const rules = Object.fromEntries(Object.entries(plugin$1.rules).map(([name, rule]) => [name, toCompatRule(rule)]));
|
|
6
|
-
for (const rule of Object.values(rules)) rule.meta.languages ??= [language];
|
|
5
|
+
const rules$1 = Object.fromEntries(Object.entries(plugin$1.rules).map(([name, rule]) => [name, toCompatRule(rule)]));
|
|
6
|
+
for (const rule of Object.values(rules$1)) rule.meta.languages ??= [language];
|
|
7
7
|
const plugin = {
|
|
8
8
|
configs: {
|
|
9
9
|
recommended: {
|
|
@@ -26,7 +26,12 @@ const plugin = {
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
meta: plugin$1.meta,
|
|
29
|
-
rules
|
|
29
|
+
rules: rules$1
|
|
30
30
|
};
|
|
31
31
|
//#endregion
|
|
32
|
-
|
|
32
|
+
//#region src/experimental/index.ts
|
|
33
|
+
const configs = plugin.configs;
|
|
34
|
+
const rules = plugin.rules;
|
|
35
|
+
var experimental_default = plugin;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { configs, experimental_default as default, rules };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { n as PackageJsonRuleModule, r as JSONSchema, t as PackageJsonPluginSettings } from "./createRule-29pC9RoP.mjs";
|
|
2
|
+
import * as parserJsonc from "jsonc-eslint-parser";
|
|
3
|
+
import { ESLint } from "eslint";
|
|
4
|
+
|
|
5
|
+
//#region src/plugin.d.ts
|
|
6
|
+
declare const plugin: {
|
|
7
|
+
configs: {
|
|
8
|
+
recommended: {
|
|
9
|
+
files: string[];
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parser: typeof parserJsonc;
|
|
12
|
+
};
|
|
13
|
+
name: string;
|
|
14
|
+
plugins: {
|
|
15
|
+
readonly 'package-json': ESLint.Plugin;
|
|
16
|
+
};
|
|
17
|
+
rules: {
|
|
18
|
+
[k: string]: "error";
|
|
19
|
+
};
|
|
20
|
+
}; /** @deprecated use the recommended config instead. this config will be removed in a future major release */
|
|
21
|
+
'recommended-publishable': {
|
|
22
|
+
files: string[];
|
|
23
|
+
languageOptions: {
|
|
24
|
+
parser: typeof parserJsonc;
|
|
25
|
+
};
|
|
26
|
+
name: string;
|
|
27
|
+
plugins: {
|
|
28
|
+
readonly 'package-json': ESLint.Plugin;
|
|
29
|
+
};
|
|
30
|
+
rules: {
|
|
31
|
+
[x: string]: "error";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
stylistic: {
|
|
35
|
+
files: string[];
|
|
36
|
+
languageOptions: {
|
|
37
|
+
parser: typeof parserJsonc;
|
|
38
|
+
};
|
|
39
|
+
name: string;
|
|
40
|
+
plugins: {
|
|
41
|
+
readonly 'package-json': ESLint.Plugin;
|
|
42
|
+
};
|
|
43
|
+
rules: {
|
|
44
|
+
[k: string]: "error";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
meta: {
|
|
49
|
+
name: string;
|
|
50
|
+
version: string;
|
|
51
|
+
};
|
|
52
|
+
rules: Record<string, PackageJsonRuleModule<unknown[], JSONSchema[]>>;
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/index.d.ts
|
|
56
|
+
declare const rules: Record<string, PackageJsonRuleModule<unknown[], JSONSchema[]>>;
|
|
57
|
+
declare const configs: {
|
|
58
|
+
recommended: {
|
|
59
|
+
files: string[];
|
|
60
|
+
languageOptions: {
|
|
61
|
+
parser: typeof import("jsonc-eslint-parser");
|
|
62
|
+
};
|
|
63
|
+
name: string;
|
|
64
|
+
plugins: {
|
|
65
|
+
readonly 'package-json': import("eslint").ESLint.Plugin;
|
|
66
|
+
};
|
|
67
|
+
rules: {
|
|
68
|
+
[k: string]: "error";
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
'recommended-publishable': {
|
|
72
|
+
files: string[];
|
|
73
|
+
languageOptions: {
|
|
74
|
+
parser: typeof import("jsonc-eslint-parser");
|
|
75
|
+
};
|
|
76
|
+
name: string;
|
|
77
|
+
plugins: {
|
|
78
|
+
readonly 'package-json': import("eslint").ESLint.Plugin;
|
|
79
|
+
};
|
|
80
|
+
rules: {
|
|
81
|
+
[x: string]: "error";
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
stylistic: {
|
|
85
|
+
files: string[];
|
|
86
|
+
languageOptions: {
|
|
87
|
+
parser: typeof import("jsonc-eslint-parser");
|
|
88
|
+
};
|
|
89
|
+
name: string;
|
|
90
|
+
plugins: {
|
|
91
|
+
readonly 'package-json': import("eslint").ESLint.Plugin;
|
|
92
|
+
};
|
|
93
|
+
rules: {
|
|
94
|
+
[k: string]: "error";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
export { type PackageJsonPluginSettings, configs, plugin as default, rules };
|
package/{lib → dist}/index.mjs
RENAMED