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.
Files changed (156) hide show
  1. package/README.md +107 -106
  2. 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
  3. package/dist/experimental/index.d.mts +68 -0
  4. package/{lib/experimental/plugin.mjs → dist/experimental/index.mjs} +10 -5
  5. package/dist/index.d.mts +99 -0
  6. package/{lib → dist}/index.mjs +1 -1
  7. package/dist/plugin-C-Z8sf5g.mjs +1737 -0
  8. package/package.json +33 -27
  9. package/lib/createRule.d.mts +0 -59
  10. package/lib/createRule.mjs +0 -24
  11. package/lib/experimental/index.d.mts +0 -34
  12. package/lib/experimental/index.mjs +0 -7
  13. package/lib/experimental/plugin.d.mts +0 -40
  14. package/lib/index.d.mts +0 -49
  15. package/lib/node_modules/.pnpm/@types_estree@1.0.8/node_modules/@types/estree/index.d.mts +0 -438
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 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
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.d.mts +0 -20
  49. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.d.mts +0 -28
  50. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.d.mts +0 -25
  51. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.d.mts +0 -25
  52. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/any.d.mts +0 -16
  53. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/array.d.mts +0 -20
  54. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/const.d.mts +0 -28
  55. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/enum.d.mts +0 -23
  56. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.d.mts +0 -24
  57. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/object.d.mts +0 -44
  58. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/primitive.d.mts +0 -16
  59. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/tuple.d.mts +0 -43
  60. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/union.d.mts +0 -13
  61. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/utils.d.mts +0 -35
  62. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/any.d.mts +0 -23
  63. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/array.d.mts +0 -24
  64. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/const.d.mts +0 -34
  65. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/enum.d.mts +0 -26
  66. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.d.mts +0 -24
  67. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/object.d.mts +0 -25
  68. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/primitive.d.mts +0 -23
  69. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/tuple.d.mts +0 -26
  70. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/union.d.mts +0 -17
  71. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/utils.d.mts +0 -10
  72. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.d.mts +0 -9
  73. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/object.d.mts +0 -49
  74. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/primitive.d.mts +0 -26
  75. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.d.mts +0 -22
  76. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.d.mts +0 -36
  77. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/type.d.mts +0 -18
  78. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.d.mts +0 -23
  79. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/utils.d.mts +0 -7
  80. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/and.d.mts +0 -4
  81. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/extends.d.mts +0 -7
  82. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/if.d.mts +0 -4
  83. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/intersectUnion.d.mts +0 -4
  84. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/isNever.d.mts +0 -4
  85. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/merge.d.mts +0 -6
  86. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/not.d.mts +0 -4
  87. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/or.d.mts +0 -4
  88. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/prettify.d.mts +0 -6
  89. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/tail.d.mts +0 -4
  90. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionLast.d.mts +0 -6
  91. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionPop.d.mts +0 -6
  92. package/lib/plugin.d.mts +0 -56
  93. package/lib/plugin.mjs +0 -93
  94. package/lib/rules/bin-name-casing.d.mts +0 -6
  95. package/lib/rules/bin-name-casing.mjs +0 -41
  96. package/lib/rules/exports-subpaths-style.d.mts +0 -18
  97. package/lib/rules/exports-subpaths-style.mjs +0 -71
  98. package/lib/rules/no-empty-fields.d.mts +0 -20
  99. package/lib/rules/no-empty-fields.mjs +0 -90
  100. package/lib/rules/no-local-dependencies.d.mts +0 -17
  101. package/lib/rules/no-local-dependencies.mjs +0 -47
  102. package/lib/rules/no-redundant-files.d.mts +0 -6
  103. package/lib/rules/no-redundant-files.mjs +0 -100
  104. package/lib/rules/no-redundant-publishConfig.d.mts +0 -6
  105. package/lib/rules/no-redundant-publishConfig.mjs +0 -50
  106. package/lib/rules/order-properties.d.mts +0 -25
  107. package/lib/rules/order-properties.mjs +0 -64
  108. package/lib/rules/repository-shorthand.d.mts +0 -18
  109. package/lib/rules/repository-shorthand.mjs +0 -111
  110. package/lib/rules/require-attribution.d.mts +0 -22
  111. package/lib/rules/require-attribution.mjs +0 -91
  112. package/lib/rules/require-properties.d.mts +0 -22
  113. package/lib/rules/require-properties.mjs +0 -74
  114. package/lib/rules/restrict-dependency-ranges.d.mts +0 -92
  115. package/lib/rules/restrict-dependency-ranges.mjs +0 -147
  116. package/lib/rules/restrict-private-properties.d.mts +0 -20
  117. package/lib/rules/restrict-private-properties.mjs +0 -53
  118. package/lib/rules/restrict-top-level-properties.d.mts +0 -39
  119. package/lib/rules/restrict-top-level-properties.mjs +0 -73
  120. package/lib/rules/scripts-name-casing.d.mts +0 -6
  121. package/lib/rules/scripts-name-casing.mjs +0 -44
  122. package/lib/rules/sort-collections.d.mts +0 -35
  123. package/lib/rules/sort-collections.mjs +0 -111
  124. package/lib/rules/specify-peers-locally.d.mts +0 -6
  125. package/lib/rules/specify-peers-locally.mjs +0 -63
  126. package/lib/rules/unique-dependencies.d.mts +0 -6
  127. package/lib/rules/unique-dependencies.mjs +0 -87
  128. package/lib/rules/valid-author.d.mts +0 -6
  129. package/lib/rules/valid-author.mjs +0 -59
  130. package/lib/rules/valid-peerDependenciesMeta-relationship.d.mts +0 -6
  131. package/lib/rules/valid-peerDependenciesMeta-relationship.mjs +0 -50
  132. package/lib/rules/valid-properties.d.mts +0 -9
  133. package/lib/rules/valid-properties.mjs +0 -57
  134. package/lib/rules/valid-repository-directory.d.mts +0 -6
  135. package/lib/rules/valid-repository-directory.mjs +0 -73
  136. package/lib/types/estree.d.mts +0 -8
  137. package/lib/utils/createSimpleRequirePropertyRule.d.mts +0 -48
  138. package/lib/utils/createSimpleRequirePropertyRule.mjs +0 -62
  139. package/lib/utils/createSimpleValidPropertyRule.d.mts +0 -17
  140. package/lib/utils/createSimpleValidPropertyRule.mjs +0 -57
  141. package/lib/utils/findPropertyWithKeyValue.d.mts +0 -10
  142. package/lib/utils/findPropertyWithKeyValue.mjs +0 -6
  143. package/lib/utils/formatErrors.d.mts +0 -9
  144. package/lib/utils/formatErrors.mjs +0 -12
  145. package/lib/utils/git/getGitAuthor.d.mts +0 -8
  146. package/lib/utils/git/getGitAuthor.mjs +0 -29
  147. package/lib/utils/git/index.d.mts +0 -2
  148. package/lib/utils/git/index.mjs +0 -2
  149. package/lib/utils/predicates/index.d.mts +0 -4
  150. package/lib/utils/predicates/index.mjs +0 -4
  151. package/lib/utils/predicates/isJSONStringLiteral.d.mts +0 -6
  152. package/lib/utils/predicates/isJSONStringLiteral.mjs +0 -6
  153. package/lib/utils/predicates/isNotNullish.d.mts +0 -4
  154. package/lib/utils/predicates/isNotNullish.mjs +0 -6
  155. package/lib/utils/predicates/isPackageJson.d.mts +0 -4
  156. package/lib/utils/predicates/isPackageJson.mjs +0 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-package-json",
3
- "version": "1.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "Rules for consistent, readable, and valid package.json files. 🗂️",
5
5
  "homepage": "https://github.com/michaelfaith/eslint-plugin-package-json#readme",
6
6
  "bugs": {
@@ -30,24 +30,24 @@
30
30
  "type": "module",
31
31
  "exports": {
32
32
  ".": {
33
- "types": "./lib/index.d.mts",
34
- "default": "./lib/index.mjs"
33
+ "types": "./dist/index.d.mts",
34
+ "default": "./dist/index.mjs"
35
35
  },
36
36
  "./experimental": {
37
- "types": "./lib/experimental/index.d.mts",
38
- "default": "./lib/experimental/index.mjs"
37
+ "types": "./dist/experimental/index.d.mts",
38
+ "default": "./dist/experimental/index.mjs"
39
39
  }
40
40
  },
41
- "main": "lib/index.mjs",
41
+ "main": "dist/index.mjs",
42
42
  "files": [
43
- "lib/"
43
+ "dist/"
44
44
  ],
45
45
  "dependencies": {
46
46
  "@altano/repository-tools": "^2.0.1",
47
47
  "change-case": "^5.4.4",
48
48
  "detect-indent": "^7.0.2",
49
49
  "detect-newline": "^4.0.1",
50
- "eslint-fix-utils": "~0.4.1",
50
+ "eslint-fix-utils": "~0.4.3",
51
51
  "eslint-json-compat-utils": "^0.2.3",
52
52
  "jsonc-eslint-parser": "^3.1.0",
53
53
  "package-json-validator": "^1.5.0",
@@ -57,8 +57,9 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@astrojs/check": "0.9.9",
60
- "@astrojs/starlight": "0.40.0",
61
- "@catppuccin/starlight": "2.0.1",
60
+ "@astrojs/markdown-satteri": "0.3.3",
61
+ "@astrojs/starlight": "0.41.3",
62
+ "@catppuccin/starlight": "2.1.0",
62
63
  "@eslint-community/eslint-plugin-eslint-comments": "4.7.2",
63
64
  "@eslint/js": "10.0.1",
64
65
  "@eslint/json": "2.0.0",
@@ -67,46 +68,51 @@
67
68
  "@types/estree": "1.0.8",
68
69
  "@types/node": "24.13.0",
69
70
  "@types/semver": "7.7.1",
71
+ "@typescript/native": "npm:typescript@7.0.2",
70
72
  "@vitest/coverage-v8": "4.1.8",
71
73
  "@vitest/eslint-plugin": "1.6.20",
72
- "astro": "6.4.2",
73
- "astro-og-canvas": "0.11.1",
74
+ "astro": "7.1.0",
75
+ "astro-og-canvas": "0.13.0",
74
76
  "canvaskit-wasm": "0.41.1",
75
77
  "console-fail-test": "0.6.0",
76
- "eslint": "10.5.0",
77
- "eslint-doc-generator": "3.6.0",
78
- "eslint-plugin-eslint-plugin": "7.4.0",
79
- "eslint-plugin-jsdoc": "63.0.2",
80
- "eslint-plugin-jsonc": "3.2.0",
81
- "eslint-plugin-n": "18.1.0",
78
+ "eslint": "10.7.0",
79
+ "eslint-doc-generator": "3.7.0",
80
+ "eslint-plugin-eslint-plugin": "7.5.0",
81
+ "eslint-plugin-jsdoc": "63.2.0",
82
+ "eslint-plugin-jsonc": "3.3.0",
83
+ "eslint-plugin-n": "18.2.1",
82
84
  "eslint-plugin-node-dependencies": "2.2.0",
83
- "eslint-plugin-perfectionist": "5.9.0",
85
+ "eslint-plugin-perfectionist": "5.10.0",
84
86
  "eslint-plugin-regexp": "3.1.0",
85
- "eslint-plugin-unicorn": "67.0.0",
86
- "eslint-plugin-yml": "3.4.0",
87
+ "eslint-plugin-unicorn": "72.0.0",
88
+ "eslint-plugin-yml": "3.6.0",
87
89
  "jiti": "2.7.0",
88
90
  "json-schema-to-ts": "3.1.1",
89
- "knip": "6.17.1",
90
- "prettier": "3.8.4",
91
+ "knip": "6.27.0",
92
+ "prettier": "3.9.0",
91
93
  "prettier-plugin-curly": "0.4.1",
92
94
  "prettier-plugin-packagejson": "3.0.2",
93
- "prettier-plugin-sh": "0.18.1",
95
+ "prettier-plugin-sh": "0.19.0",
94
96
  "pretty-quick": "4.2.2",
95
97
  "sharp": "0.35.0",
96
98
  "simple-git-hooks": "2.13.1",
97
99
  "starlight-auto-sidebar": "0.4.0",
98
100
  "tsdown": "0.22.2",
99
- "typescript": "6.0.3",
100
- "typescript-eslint": "8.61.0",
101
+ "typescript": "npm:@typescript/typescript6@6.0.2",
102
+ "typescript-eslint": "8.65.0",
101
103
  "vitest": "4.1.8"
102
104
  },
103
105
  "peerDependencies": {
104
106
  "@eslint/json": ">=1.0.0",
107
+ "@types/estree": ">=1.0.0",
105
108
  "eslint": ">=9.0.0"
106
109
  },
107
110
  "peerDependenciesMeta": {
108
111
  "@eslint/json": {
109
112
  "optional": true
113
+ },
114
+ "@types/estree": {
115
+ "optional": true
110
116
  }
111
117
  },
112
118
  "engines": {
@@ -114,7 +120,7 @@
114
120
  },
115
121
  "scripts": {
116
122
  "build": "tsdown",
117
- "docs:generate": "pnpm build --no-dts && eslint-doc-generator",
123
+ "docs:generate": "pnpm build --no-dts && eslint-doc-generator --ignore-config recommended-publishable",
118
124
  "format": "prettier .",
119
125
  "lint": "eslint . --max-warnings 0",
120
126
  "lint:knip": "knip",
@@ -1,59 +0,0 @@
1
- import { Expression, ExpressionStatement } from "./node_modules/.pnpm/@types_estree@1.0.8/node_modules/@types/estree/index.mjs";
2
- import { JSONSchema } from "./node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.mjs";
3
- import { FromSchema } from "./node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/index.mjs";
4
- import { AST, RuleListener } from "jsonc-eslint-parser";
5
- import { AST as AST$1, Rule, SourceCode } from "eslint";
6
-
7
- //#region src/createRule.d.ts
8
- type ASTBodyExpression = Expression & {
9
- properties: ASTBodyProperty[];
10
- };
11
- type ASTBodyProperty = AST.JSONProperty & {
12
- value: string;
13
- };
14
- interface ASTBodyStatement extends ExpressionStatement {
15
- expression: ASTBodyExpression;
16
- }
17
- interface PackageAST extends AST$1.Program {
18
- body: [ASTBodyStatement];
19
- }
20
- interface PackageJsonPluginSettings {
21
- /**
22
- * Whether `require-*` rules, if used, should enforce the presence of
23
- * the corresponding property *in package.json files with `"private": true`*.
24
- *
25
- * If not specified, it will not enforce the presence only of `name` and `version` properties.
26
- */
27
- enforceForPrivate?: boolean;
28
- }
29
- interface PackageJsonRuleContext<Options extends unknown[] = unknown[]> extends Rule.RuleContext {
30
- options: Options;
31
- settings: {
32
- packageJson?: PackageJsonPluginSettings;
33
- };
34
- sourceCode: PackageJsonSourceCode;
35
- }
36
- interface PackageJsonRuleModule<Options extends unknown[] = unknown[], Schema extends JSONSchema[] = JSONSchema[]> {
37
- create(context: PackageJsonRuleContext<Options>): RuleListener;
38
- meta: Omit<Rule.RuleMetaData, 'defaultOptions' | 'docs' | 'schema'> & {
39
- defaultOptions?: NoInfer<Options>;
40
- docs?: Rule.RuleMetaData['docs'] & {
41
- category?: string; /** An optional route segment to group this rule under */
42
- ruleGroup?: string;
43
- };
44
- schema?: Schema;
45
- };
46
- }
47
- interface PackageJsonSourceCode extends SourceCode {
48
- ast: PackageAST;
49
- }
50
- type InferJsonSchemasTupleType<T extends JSONSchema[]> = { [K in keyof T]?: FromSchema<T[K]> };
51
- /**
52
- * Rule options type is inferred from the JSON schema by [json-schema-to-ts](https://www.npmjs.com/package/json-schema-to-ts).
53
- * If you're not satisfied with the inferred type, you may specify it manually in the first type parameter.
54
- */
55
- declare function createRule<OptionsOverride extends unknown[] = never, const Schema extends JSONSchema[] = JSONSchema[], _OptionsResolved extends unknown[] = ([OptionsOverride] extends [never] ? InferJsonSchemasTupleType<Schema> : OptionsOverride)>(rule: PackageJsonRuleModule<_OptionsResolved, Schema> & {
56
- name: string;
57
- }): PackageJsonRuleModule<_OptionsResolved, Schema>;
58
- //#endregion
59
- export { ASTBodyExpression, ASTBodyProperty, ASTBodyStatement, PackageAST, PackageJsonPluginSettings, PackageJsonRuleContext, PackageJsonRuleModule, PackageJsonSourceCode, createRule };
@@ -1,24 +0,0 @@
1
- import { isPackageJson } from "./utils/predicates/isPackageJson.mjs";
2
- //#region src/createRule.ts
3
- /**
4
- * Rule options type is inferred from the JSON schema by [json-schema-to-ts](https://www.npmjs.com/package/json-schema-to-ts).
5
- * If you're not satisfied with the inferred type, you may specify it manually in the first type parameter.
6
- */
7
- function createRule(rule) {
8
- const ruleGroup = rule.meta.docs?.ruleGroup;
9
- return {
10
- create(context) {
11
- if (!isPackageJson(context.filename)) return {};
12
- return rule.create(context);
13
- },
14
- meta: {
15
- ...rule.meta,
16
- docs: {
17
- ...rule.meta.docs,
18
- url: `https://eslint-plugin-package-json.dev/rules/${ruleGroup ? `${ruleGroup}/` : ""}${rule.name}`
19
- }
20
- }
21
- };
22
- }
23
- //#endregion
24
- export { createRule };
@@ -1,34 +0,0 @@
1
- import { JSONSchema } from "../node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.mjs";
2
- import { PackageJsonPluginSettings, PackageJsonRuleModule } from "../createRule.mjs";
3
- import { plugin } from "./plugin.mjs";
4
-
5
- //#region src/experimental/index.d.ts
6
- declare const configs: {
7
- recommended: {
8
- files: string[];
9
- language: string;
10
- name: string;
11
- plugins: {
12
- readonly 'package-json': import("eslint").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': import("eslint").ESLint.Plugin;
24
- };
25
- rules: {
26
- [k: string]: "error";
27
- };
28
- };
29
- };
30
- declare const rules: {
31
- [k: string]: PackageJsonRuleModule<unknown[], JSONSchema[]>;
32
- };
33
- //#endregion
34
- export { type PackageJsonPluginSettings, configs, plugin as default, rules };
@@ -1,7 +0,0 @@
1
- import { plugin } from "./plugin.mjs";
2
- //#region src/experimental/index.ts
3
- const configs = plugin.configs;
4
- const rules = plugin.rules;
5
- var experimental_default = plugin;
6
- //#endregion
7
- export { configs, experimental_default as default, rules };
@@ -1,40 +0,0 @@
1
- import { JSONSchema } from "../node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.mjs";
2
- import { PackageJsonRuleModule } from "../createRule.mjs";
3
- import { ESLint } from "eslint";
4
-
5
- //#region src/experimental/plugin.d.ts
6
- declare const plugin: {
7
- configs: {
8
- recommended: {
9
- files: string[];
10
- language: string;
11
- name: string;
12
- plugins: {
13
- readonly 'package-json': ESLint.Plugin;
14
- };
15
- rules: {
16
- [k: string]: "error";
17
- };
18
- };
19
- stylistic: {
20
- files: string[];
21
- language: string;
22
- name: string;
23
- plugins: {
24
- readonly 'package-json': ESLint.Plugin;
25
- };
26
- rules: {
27
- [k: string]: "error";
28
- };
29
- };
30
- };
31
- meta: {
32
- name: string;
33
- version: string;
34
- };
35
- rules: {
36
- [k: string]: PackageJsonRuleModule<unknown[], JSONSchema[]>;
37
- };
38
- };
39
- //#endregion
40
- export { plugin };
package/lib/index.d.mts DELETED
@@ -1,49 +0,0 @@
1
- import { JSONSchema } from "./node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.mjs";
2
- import { PackageJsonPluginSettings, PackageJsonRuleModule } from "./createRule.mjs";
3
- import { plugin } from "./plugin.mjs";
4
-
5
- //#region src/index.d.ts
6
- declare const rules: Record<string, PackageJsonRuleModule<unknown[], JSONSchema[]>>;
7
- declare const configs: {
8
- recommended: {
9
- files: string[];
10
- languageOptions: {
11
- parser: typeof import("jsonc-eslint-parser");
12
- };
13
- name: string;
14
- plugins: {
15
- readonly 'package-json': import("eslint").ESLint.Plugin;
16
- };
17
- rules: {
18
- [k: string]: "error";
19
- };
20
- };
21
- 'recommended-publishable': {
22
- files: string[];
23
- languageOptions: {
24
- parser: typeof import("jsonc-eslint-parser");
25
- };
26
- name: string;
27
- plugins: {
28
- readonly 'package-json': import("eslint").ESLint.Plugin;
29
- };
30
- rules: {
31
- [x: string]: "error";
32
- };
33
- };
34
- stylistic: {
35
- files: string[];
36
- languageOptions: {
37
- parser: typeof import("jsonc-eslint-parser");
38
- };
39
- name: string;
40
- plugins: {
41
- readonly 'package-json': import("eslint").ESLint.Plugin;
42
- };
43
- rules: {
44
- [k: string]: "error";
45
- };
46
- };
47
- };
48
- //#endregion
49
- export { type PackageJsonPluginSettings, configs, plugin as default, rules };