eslint-plugin-package-json 1.4.0 → 1.6.0

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 (146) hide show
  1. package/README.md +107 -106
  2. package/{lib/node_modules/.pnpm/@types_estree@1.0.8/node_modules/@types/estree/index.d.mts → dist/createRule-B1Ow8h0I.d.mts} +104 -1
  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-kxKPlCNd.mjs +1737 -0
  8. package/package.json +26 -24
  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/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/deserializationPattern.d.mts +0 -7
  16. 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
  17. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.d.mts +0 -60
  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 -91
  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 -99
  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 -73
  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 -86
  128. package/lib/rules/valid-peerDependenciesMeta-relationship.d.mts +0 -6
  129. package/lib/rules/valid-peerDependenciesMeta-relationship.mjs +0 -50
  130. package/lib/rules/valid-properties.d.mts +0 -9
  131. package/lib/rules/valid-properties.mjs +0 -58
  132. package/lib/rules/valid-repository-directory.d.mts +0 -6
  133. package/lib/rules/valid-repository-directory.mjs +0 -73
  134. package/lib/types/estree.d.mts +0 -8
  135. package/lib/utils/createSimpleRequirePropertyRule.d.mts +0 -48
  136. package/lib/utils/createSimpleRequirePropertyRule.mjs +0 -59
  137. package/lib/utils/createSimpleValidPropertyRule.d.mts +0 -17
  138. package/lib/utils/createSimpleValidPropertyRule.mjs +0 -57
  139. package/lib/utils/findPropertyWithKeyValue.d.mts +0 -10
  140. package/lib/utils/findPropertyWithKeyValue.mjs +0 -6
  141. package/lib/utils/formatErrors.d.mts +0 -9
  142. package/lib/utils/formatErrors.mjs +0 -12
  143. package/lib/utils/isPackageJson.d.mts +0 -4
  144. package/lib/utils/isPackageJson.mjs +0 -4
  145. package/lib/utils/predicates.d.mts +0 -7
  146. package/lib/utils/predicates.mjs +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-package-json",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
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,37 +68,38 @@
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.0.6",
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",
78
+ "eslint": "10.6.0",
77
79
  "eslint-doc-generator": "3.6.0",
78
80
  "eslint-plugin-eslint-plugin": "7.4.0",
79
81
  "eslint-plugin-jsdoc": "63.0.2",
80
- "eslint-plugin-jsonc": "3.2.0",
81
- "eslint-plugin-n": "18.1.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": "66.0.0",
86
- "eslint-plugin-yml": "3.4.0",
87
+ "eslint-plugin-unicorn": "71.1.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.16.0",
90
- "prettier": "3.8.4",
91
+ "knip": "6.26.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.63.0",
101
103
  "vitest": "4.1.8"
102
104
  },
103
105
  "peerDependencies": {
@@ -114,7 +116,7 @@
114
116
  },
115
117
  "scripts": {
116
118
  "build": "tsdown",
117
- "docs:generate": "pnpm build --no-dts && eslint-doc-generator",
119
+ "docs:generate": "pnpm build --no-dts && eslint-doc-generator --ignore-config recommended-publishable",
118
120
  "format": "prettier .",
119
121
  "lint": "eslint . --max-warnings 0",
120
122
  "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 JsonAstBodyExpression = Expression & {
9
- properties: JsonAstBodyProperty[];
10
- };
11
- type JsonAstBodyProperty = AST.JSONProperty & {
12
- value: string;
13
- };
14
- interface JsonAstBodyStatement extends ExpressionStatement {
15
- expression: JsonAstBodyExpression;
16
- }
17
- interface PackageJsonAst extends AST$1.Program {
18
- body: [JsonAstBodyStatement];
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: PackageJsonAst;
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 { JsonAstBodyExpression, JsonAstBodyProperty, JsonAstBodyStatement, PackageJsonAst, PackageJsonPluginSettings, PackageJsonRuleContext, PackageJsonRuleModule, PackageJsonSourceCode, createRule };
@@ -1,24 +0,0 @@
1
- import { isPackageJson } from "./utils/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 };
@@ -1,7 +0,0 @@
1
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/deserializationPattern.d.ts
2
- type DeserializationPattern = Readonly<{
3
- pattern: unknown;
4
- output: unknown;
5
- }>;
6
- //#endregion
7
- export { DeserializationPattern };
@@ -1,20 +0,0 @@
1
- import { DeserializationPattern } from "./deserializationPattern.mjs";
2
- import { JSONSchemaReference } from "./jsonSchema.mjs";
3
-
4
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/fromSchemaOptions.d.ts
5
- type FromSchemaOptions = {
6
- parseNotKeyword?: boolean;
7
- parseIfThenElseKeywords?: boolean;
8
- keepDefaultedPropertiesOptional?: boolean;
9
- references?: JSONSchemaReference[] | false;
10
- deserialize?: DeserializationPattern[] | false;
11
- };
12
- type FromSchemaDefaultOptions = {
13
- parseNotKeyword: false;
14
- parseIfThenElseKeywords: false;
15
- keepDefaultedPropertiesOptional: false;
16
- references: false;
17
- deserialize: false;
18
- };
19
- //#endregion
20
- export { FromSchemaDefaultOptions, FromSchemaOptions };
@@ -1,60 +0,0 @@
1
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.d.ts
2
- declare const $JSONSchema: unique symbol;
3
- type $JSONSchema = typeof $JSONSchema;
4
- type JSONSchemaType = "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
5
- type JSONSchema = boolean | Readonly<{
6
- [$JSONSchema]?: $JSONSchema;
7
- $id?: string | undefined;
8
- $ref?: string | undefined;
9
- $schema?: string | undefined;
10
- $comment?: string | undefined;
11
- type?: JSONSchemaType | readonly JSONSchemaType[];
12
- const?: unknown;
13
- enum?: unknown;
14
- multipleOf?: number | undefined;
15
- maximum?: number | undefined;
16
- exclusiveMaximum?: number | undefined;
17
- minimum?: number | undefined;
18
- exclusiveMinimum?: number | undefined;
19
- maxLength?: number | undefined;
20
- minLength?: number | undefined;
21
- pattern?: string | undefined;
22
- items?: JSONSchema | readonly JSONSchema[];
23
- additionalItems?: JSONSchema;
24
- contains?: JSONSchema;
25
- maxItems?: number | undefined;
26
- minItems?: number | undefined;
27
- uniqueItems?: boolean | undefined;
28
- maxProperties?: number | undefined;
29
- minProperties?: number | undefined;
30
- required?: readonly string[];
31
- properties?: Readonly<Record<string, JSONSchema>>;
32
- patternProperties?: Readonly<Record<string, JSONSchema>>;
33
- additionalProperties?: JSONSchema;
34
- unevaluatedProperties?: JSONSchema;
35
- dependencies?: Readonly<Record<string, JSONSchema | readonly string[]>>;
36
- propertyNames?: JSONSchema;
37
- if?: JSONSchema;
38
- then?: JSONSchema;
39
- else?: JSONSchema;
40
- allOf?: readonly JSONSchema[];
41
- anyOf?: readonly JSONSchema[];
42
- oneOf?: readonly JSONSchema[];
43
- not?: JSONSchema;
44
- format?: string | undefined;
45
- contentMediaType?: string | undefined;
46
- contentEncoding?: string | undefined;
47
- definitions?: Readonly<Record<string, JSONSchema>>;
48
- title?: string | undefined;
49
- description?: string | undefined;
50
- default?: unknown;
51
- readOnly?: boolean | undefined;
52
- writeOnly?: boolean | undefined;
53
- examples?: readonly unknown[];
54
- nullable?: boolean;
55
- }>;
56
- type JSONSchemaReference = JSONSchema & Readonly<{
57
- $id: string;
58
- }>;
59
- //#endregion
60
- export { JSONSchema, JSONSchemaReference, JSONSchemaType };
@@ -1,11 +0,0 @@
1
- import { $Resolve } from "../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.mjs";
2
- import { DeserializationPattern } from "./definitions/deserializationPattern.mjs";
3
- import { JSONSchema } from "./definitions/jsonSchema.mjs";
4
- import { FromSchemaDefaultOptions, FromSchemaOptions } from "./definitions/fromSchemaOptions.mjs";
5
- import { ParseOptions } from "./parse-options.mjs";
6
- import { ParseSchema } from "./parse-schema/index.mjs";
7
-
8
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/index.d.ts
9
- type FromSchema<SCHEMA extends JSONSchema, OPTIONS extends FromSchemaOptions = FromSchemaDefaultOptions> = $Resolve<ParseSchema<SCHEMA, ParseOptions<SCHEMA, OPTIONS>>>;
10
- //#endregion
11
- export { FromSchema };
@@ -1,16 +0,0 @@
1
- import { DeserializationPattern } from "./definitions/deserializationPattern.mjs";
2
- import { JSONSchema, JSONSchemaReference } from "./definitions/jsonSchema.mjs";
3
- import { FromSchemaDefaultOptions, FromSchemaOptions } from "./definitions/fromSchemaOptions.mjs";
4
-
5
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-options.d.ts
6
- type IndexReferencesById<SCHEMA_REFERENCES extends readonly JSONSchemaReference[]> = { [REF_SCHEMA in SCHEMA_REFERENCES[number] as REF_SCHEMA["$id"]]: REF_SCHEMA };
7
- type ParseOptions<ROOT_SCHEMA extends JSONSchema, OPTIONS extends FromSchemaOptions> = {
8
- parseNotKeyword: OPTIONS["parseNotKeyword"] extends boolean ? OPTIONS["parseNotKeyword"] : FromSchemaDefaultOptions["parseNotKeyword"];
9
- parseIfThenElseKeywords: OPTIONS["parseIfThenElseKeywords"] extends boolean ? OPTIONS["parseIfThenElseKeywords"] : FromSchemaDefaultOptions["parseIfThenElseKeywords"];
10
- keepDefaultedPropertiesOptional: OPTIONS["keepDefaultedPropertiesOptional"] extends boolean ? OPTIONS["keepDefaultedPropertiesOptional"] : FromSchemaDefaultOptions["keepDefaultedPropertiesOptional"];
11
- rootSchema: ROOT_SCHEMA;
12
- references: OPTIONS["references"] extends JSONSchemaReference[] ? IndexReferencesById<OPTIONS["references"]> : {};
13
- deserialize: OPTIONS["deserialize"] extends DeserializationPattern[] | false ? OPTIONS["deserialize"] : FromSchemaDefaultOptions["deserialize"];
14
- };
15
- //#endregion
16
- export { ParseOptions };
@@ -1,13 +0,0 @@
1
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
2
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
3
- import { MergeSubSchema } from "./utils.mjs";
4
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
5
-
6
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/allOf.d.ts
7
- type AllOfSchema = JSONSchema & Readonly<{
8
- allOf: readonly JSONSchema[];
9
- }>;
10
- type ParseAllOfSchema<ALL_OF_SCHEMA extends AllOfSchema, OPTIONS extends ParseSchemaOptions> = RecurseOnAllOfSchema<ALL_OF_SCHEMA["allOf"], ALL_OF_SCHEMA, OPTIONS, ParseSchema<Omit<ALL_OF_SCHEMA, "allOf">, OPTIONS>>;
11
- type RecurseOnAllOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ALL_OF_SCHEMA extends AllOfSchema, OPTIONS extends ParseSchemaOptions, PARSED_ROOT_ALL_OF_SCHEMA> = SUB_SCHEMAS extends readonly [infer SUB_SCHEMAS_HEAD, ...infer SUB_SCHEMAS_TAIL] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnAllOfSchema<SUB_SCHEMAS_TAIL, ROOT_ALL_OF_SCHEMA, OPTIONS, $Intersect<ParseSchema<MergeSubSchema<Omit<ROOT_ALL_OF_SCHEMA, "allOf">, SUB_SCHEMAS_HEAD>, OPTIONS>, PARSED_ROOT_ALL_OF_SCHEMA>> : never : never : PARSED_ROOT_ALL_OF_SCHEMA;
12
- //#endregion
13
- export { AllOfSchema, ParseAllOfSchema };
@@ -1,14 +0,0 @@
1
- import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
- import { MergeSubSchema } from "./utils.mjs";
5
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
-
7
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/anyOf.d.ts
8
- type AnyOfSchema = JSONSchema & Readonly<{
9
- anyOf: readonly JSONSchema[];
10
- }>;
11
- type ParseAnyOfSchema<ANY_OF_SCHEMA extends AnyOfSchema, OPTIONS extends ParseSchemaOptions> = $Union<RecurseOnAnyOfSchema<ANY_OF_SCHEMA["anyOf"], ANY_OF_SCHEMA, OPTIONS>>;
12
- type RecurseOnAnyOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ANY_OF_SCHEMA extends AnyOfSchema, OPTIONS extends ParseSchemaOptions, RESULT = never> = SUB_SCHEMAS extends readonly [infer SUB_SCHEMAS_HEAD, ...infer SUB_SCHEMAS_TAIL] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnAnyOfSchema<SUB_SCHEMAS_TAIL, ROOT_ANY_OF_SCHEMA, OPTIONS, RESULT | $Intersect<ParseSchema<Omit<ROOT_ANY_OF_SCHEMA, "anyOf">, OPTIONS>, ParseSchema<MergeSubSchema<Omit<ROOT_ANY_OF_SCHEMA, "anyOf">, SUB_SCHEMAS_HEAD>, OPTIONS>>> : never : never : RESULT;
13
- //#endregion
14
- export { AnyOfSchema, ParseAnyOfSchema };
@@ -1,58 +0,0 @@
1
- import { Never } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.mjs";
2
- import { $Tuple } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.mjs";
3
- import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
4
- import { _$Array } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.mjs";
5
- import { Any } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.mjs";
6
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
7
- import { And } from "../type-utils/and.mjs";
8
- import { DoesExtend } from "../type-utils/extends.mjs";
9
- import { Not } from "../type-utils/not.mjs";
10
- import { Tail } from "../type-utils/tail.mjs";
11
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
12
-
13
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/array.d.ts
14
- type ArrayOrTupleSchema = JSONSchema & Readonly<{
15
- type: "array";
16
- }>;
17
- type ArraySchema = Omit<JSONSchema, "items"> & Readonly<{
18
- type: "array";
19
- items: JSONSchema;
20
- }>;
21
- type TupleSchema = JSONSchema & Readonly<{
22
- type: "array";
23
- items: readonly JSONSchema[];
24
- }>;
25
- type ParseArrayOrTupleSchema<ARRAY_OR_TUPLE_SCHEMA extends ArrayOrTupleSchema, OPTIONS extends ParseSchemaOptions> = ARRAY_OR_TUPLE_SCHEMA extends ArraySchema ? _$Array<ParseSchema<ARRAY_OR_TUPLE_SCHEMA["items"], OPTIONS>> : ARRAY_OR_TUPLE_SCHEMA extends TupleSchema ? $Union<ApplyMinMaxAndAdditionalItems<ParseTupleItems<ARRAY_OR_TUPLE_SCHEMA["items"], OPTIONS>, ARRAY_OR_TUPLE_SCHEMA, OPTIONS>> : _$Array;
26
- type ParseTupleItems<ITEM_SCHEMAS extends readonly JSONSchema[], OPTIONS extends ParseSchemaOptions> = ITEM_SCHEMAS extends readonly [infer ITEM_SCHEMAS_HEAD, ...infer ITEM_SCHEMAS_TAIL] ? ITEM_SCHEMAS_HEAD extends JSONSchema ? ITEM_SCHEMAS_TAIL extends readonly JSONSchema[] ? [ParseSchema<ITEM_SCHEMAS_HEAD, OPTIONS>, ...ParseTupleItems<ITEM_SCHEMAS_TAIL, OPTIONS>] : never : never : [];
27
- type ApplyMinMaxAndAdditionalItems<PARSED_ITEM_SCHEMAS extends any[], ROOT_SCHEMA extends ArrayOrTupleSchema, OPTIONS extends ParseSchemaOptions> = ApplyAdditionalItems<ApplyMinMax<PARSED_ITEM_SCHEMAS, ROOT_SCHEMA extends Readonly<{
28
- minItems: number;
29
- }> ? ROOT_SCHEMA["minItems"] : 0, ROOT_SCHEMA extends Readonly<{
30
- maxItems: number;
31
- }> ? ROOT_SCHEMA["maxItems"] : undefined>, ROOT_SCHEMA extends Readonly<{
32
- additionalItems: JSONSchema;
33
- }> ? ROOT_SCHEMA["additionalItems"] : true, OPTIONS>;
34
- type ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS extends any[], MIN extends number, MAX extends number | undefined, RESULT = never, HAS_ENCOUNTERED_MIN extends boolean = false, HAS_ENCOUNTERED_MAX extends boolean = false, INITIAL_PARSED_ITEM_SCHEMAS extends any[] = RECURSED_PARSED_ITEM_SCHEMAS> = And<Not<DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>>, DoesExtend<RECURSED_PARSED_ITEM_SCHEMAS, [any, ...any[]]>> extends true ? RECURSED_PARSED_ITEM_SCHEMAS extends [...infer RECURSED_PARSED_ITEM_SCHEMAS_BODY, unknown] ? ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS_BODY, MIN, MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"] extends MAX ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>, HAS_ENCOUNTERED_MIN extends true ? true : DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, HAS_ENCOUNTERED_MAX extends true ? true : DoesExtend<MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, INITIAL_PARSED_ITEM_SCHEMAS> : never : {
35
- result: MAX extends undefined ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : HAS_ENCOUNTERED_MAX extends true ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX> extends true ? never : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>;
36
- hasEncounteredMin: DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>;
37
- hasEncounteredMax: HAS_ENCOUNTERED_MAX extends true ? true : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? true : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX>;
38
- completeTuple: INITIAL_PARSED_ITEM_SCHEMAS;
39
- };
40
- type IsLongerThan<TUPLE extends any[], LENGTH extends number | undefined, RESULT extends boolean = false> = LENGTH extends undefined ? false : TUPLE["length"] extends LENGTH ? true : TUPLE extends [any, ...infer TUPLE_TAIL] ? IsLongerThan<TUPLE_TAIL, LENGTH> : RESULT;
41
- type ApplyAdditionalItems<APPLY_MIN_MAX_RESULT extends {
42
- result: any;
43
- hasEncounteredMin: boolean;
44
- hasEncounteredMax: boolean;
45
- completeTuple: any[];
46
- }, ADDITIONAL_ITEMS_SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions> = APPLY_MIN_MAX_RESULT extends {
47
- hasEncounteredMax: true;
48
- } ? APPLY_MIN_MAX_RESULT extends {
49
- hasEncounteredMin: true;
50
- } ? APPLY_MIN_MAX_RESULT["result"] : Never : ADDITIONAL_ITEMS_SCHEMA extends false ? APPLY_MIN_MAX_RESULT extends {
51
- hasEncounteredMin: true;
52
- } ? APPLY_MIN_MAX_RESULT["result"] : Never : ADDITIONAL_ITEMS_SCHEMA extends true ? APPLY_MIN_MAX_RESULT extends {
53
- hasEncounteredMin: true;
54
- } ? APPLY_MIN_MAX_RESULT["result"] | $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], Any> : $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], Any> : APPLY_MIN_MAX_RESULT extends {
55
- hasEncounteredMin: true;
56
- } ? APPLY_MIN_MAX_RESULT["result"] | $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], ParseSchema<ADDITIONAL_ITEMS_SCHEMA, OPTIONS>> : $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], ParseSchema<ADDITIONAL_ITEMS_SCHEMA, OPTIONS>>;
57
- //#endregion
58
- export { ArrayOrTupleSchema, ParseArrayOrTupleSchema };
@@ -1,14 +0,0 @@
1
- import { Const } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
- import { Writable } from "../type-utils/writable.mjs";
5
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
-
7
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/const.d.ts
8
- type ConstSchema = JSONSchema & Readonly<{
9
- const: unknown;
10
- }>;
11
- type ParseConstSchema<CONST_SCHEMA extends ConstSchema, OPTIONS extends ParseSchemaOptions> = $Intersect<ParseConst<CONST_SCHEMA>, ParseSchema<Omit<CONST_SCHEMA, "const">, OPTIONS>>;
12
- type ParseConst<CONST_SCHEMA extends ConstSchema> = Const<Writable<CONST_SCHEMA["const"]>>;
13
- //#endregion
14
- export { ConstSchema, ParseConstSchema };
@@ -1,13 +0,0 @@
1
- import { Any } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { DeserializationPattern } from "../definitions/deserializationPattern.mjs";
4
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
5
- import { ParseSchemaOptions } from "./index.mjs";
6
-
7
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/deserialize.d.ts
8
- type DeserializeSchema<SCHEMA extends JSONSchema, OPTIONS extends Omit<ParseSchemaOptions, "deserialize"> & {
9
- deserialize: DeserializationPattern[];
10
- }> = RecurseOnDeserializationPatterns<SCHEMA, OPTIONS["deserialize"]>;
11
- type RecurseOnDeserializationPatterns<SCHEMA extends JSONSchema, DESERIALIZATION_PATTERNS extends DeserializationPattern[], RESULT = Any> = DESERIALIZATION_PATTERNS extends [infer DESERIALIZATION_PATTERNS_HEAD, ...infer DESERIALIZATION_PATTERNS_TAIL] ? DESERIALIZATION_PATTERNS_HEAD extends DeserializationPattern ? DESERIALIZATION_PATTERNS_TAIL extends DeserializationPattern[] ? RecurseOnDeserializationPatterns<SCHEMA, DESERIALIZATION_PATTERNS_TAIL, SCHEMA extends DESERIALIZATION_PATTERNS_HEAD["pattern"] ? $Intersect<Any<true, DESERIALIZATION_PATTERNS_HEAD["output"]>, RESULT> : RESULT> : never : never : RESULT;
12
- //#endregion
13
- export { DeserializeSchema };
@@ -1,14 +0,0 @@
1
- import { Enum } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
- import { Writable } from "../type-utils/writable.mjs";
5
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
-
7
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/enum.d.ts
8
- type EnumSchema = JSONSchema & Readonly<{
9
- enum: readonly unknown[];
10
- }>;
11
- type ParseEnumSchema<ENUM_SCHEMA extends EnumSchema, OPTIONS extends ParseSchemaOptions> = $Intersect<ParseEnum<ENUM_SCHEMA>, ParseSchema<Omit<ENUM_SCHEMA, "enum">, OPTIONS>>;
12
- type ParseEnum<ENUM_SCHEMA extends EnumSchema> = Enum<Writable<ENUM_SCHEMA["enum"][number]>>;
13
- //#endregion
14
- export { EnumSchema, ParseEnumSchema };
@@ -1,20 +0,0 @@
1
- import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
2
- import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
- import { _$Exclude } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.mjs";
4
- import { JSONSchema } from "../definitions/jsonSchema.mjs";
5
- import { MergeSubSchema } from "./utils.mjs";
6
- import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
7
-
8
- //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/ifThenElse.d.ts
9
- type IfThenElseSchema = JSONSchema & {
10
- if: JSONSchema;
11
- then?: JSONSchema;
12
- else?: JSONSchema;
13
- };
14
- type ParseIfThenElseSchema<IF_THEN_ELSE_SCHEMA extends IfThenElseSchema, OPTIONS extends ParseSchemaOptions, REST_SCHEMA extends JSONSchema = Omit<IF_THEN_ELSE_SCHEMA, "if" | "then" | "else">, IF_SCHEMA extends JSONSchema = MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["if"]>, PARSED_THEN_SCHEMA = (IF_THEN_ELSE_SCHEMA extends {
15
- then: JSONSchema;
16
- } ? $Intersect<ParseSchema<IF_SCHEMA, OPTIONS>, ParseSchema<MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["then"]>, OPTIONS>> : ParseSchema<IF_SCHEMA, OPTIONS>), PARSED_ELSE_SCHEMA = (IF_THEN_ELSE_SCHEMA extends {
17
- else: JSONSchema;
18
- } ? $Intersect<_$Exclude<ParseSchema<REST_SCHEMA, OPTIONS>, ParseSchema<IF_SCHEMA, OPTIONS>>, ParseSchema<MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["else"]>, OPTIONS>> : _$Exclude<ParseSchema<REST_SCHEMA, OPTIONS>, ParseSchema<IF_SCHEMA, OPTIONS>>)> = $Intersect<$Union<PARSED_THEN_SCHEMA | PARSED_ELSE_SCHEMA>, ParseSchema<REST_SCHEMA, OPTIONS>>;
19
- //#endregion
20
- export { IfThenElseSchema, ParseIfThenElseSchema };