eslint-plugin-package-json 0.89.3 → 0.90.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 (35) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +7 -0
  3. package/lib/createRule.mjs +1 -3
  4. package/lib/index.d.mts +4 -4
  5. package/lib/index.mjs +1 -3
  6. package/lib/plugin.mjs +1 -3
  7. package/lib/rules/bin-name-casing.mjs +1 -3
  8. package/lib/rules/exports-subpaths-style.mjs +1 -3
  9. package/lib/rules/no-empty-fields.mjs +1 -3
  10. package/lib/rules/no-redundant-files.mjs +1 -3
  11. package/lib/rules/no-redundant-publishConfig.mjs +1 -3
  12. package/lib/rules/order-properties.mjs +1 -3
  13. package/lib/rules/repository-shorthand.mjs +1 -3
  14. package/lib/rules/require-attribution.mjs +1 -3
  15. package/lib/rules/require-properties.d.mts +2 -2
  16. package/lib/rules/require-properties.mjs +5 -3
  17. package/lib/rules/restrict-dependency-ranges.mjs +1 -3
  18. package/lib/rules/restrict-private-properties.mjs +1 -3
  19. package/lib/rules/scripts-name-casing.mjs +1 -3
  20. package/lib/rules/sort-collections.mjs +1 -3
  21. package/lib/rules/specify-peers-locally.mjs +1 -3
  22. package/lib/rules/unique-dependencies.mjs +1 -3
  23. package/lib/rules/valid-name.mjs +1 -3
  24. package/lib/rules/valid-package-definition.mjs +1 -3
  25. package/lib/rules/valid-properties.mjs +5 -4
  26. package/lib/rules/valid-repository-directory.mjs +1 -3
  27. package/lib/rules/valid-version.mjs +1 -3
  28. package/lib/utils/createSimpleRequirePropertyRule.d.mts +2 -2
  29. package/lib/utils/createSimpleRequirePropertyRule.mjs +2 -4
  30. package/lib/utils/createSimpleValidPropertyRule.mjs +1 -3
  31. package/lib/utils/findPropertyWithKeyValue.mjs +1 -2
  32. package/lib/utils/formatErrors.mjs +1 -2
  33. package/lib/utils/isPackageJson.mjs +1 -2
  34. package/lib/utils/predicates.mjs +1 -2
  35. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.90.0](https://github.com/michaelfaith/eslint-plugin-package-json/compare/v0.89.4...v0.90.0) (2026-03-10)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * add `valid-funding` rule ([#1643](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1643))
9
+ * add `valid-bugs` rule ([#1644](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1644))
10
+ * add `valid-packageManager` rule ([#1640](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1640))
11
+
12
+ ### 🚀 Features
13
+
14
+ * add `valid-bugs` rule ([#1644](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1644)) ([f981fa3](https://github.com/michaelfaith/eslint-plugin-package-json/commit/f981fa38ab4f1630c6db0933d859974d0a6ec0b3))
15
+ * add `valid-funding` rule ([#1643](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1643)) ([5b3c77d](https://github.com/michaelfaith/eslint-plugin-package-json/commit/5b3c77da9b8edcd659a1fd9b3e51d1e43803aa5e))
16
+ * add `valid-packageManager` rule ([#1640](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1640)) ([9a65480](https://github.com/michaelfaith/eslint-plugin-package-json/commit/9a65480cb55a4d03043916def549cfd7fc4b604b))
17
+
18
+ ## [0.89.4](https://github.com/michaelfaith/eslint-plugin-package-json/compare/v0.89.3...v0.89.4) (2026-03-07)
19
+
20
+
21
+ ### 🚀 Features
22
+
23
+ * add `require-main` rule ([#1631](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1631)) ([f3ea3e6](https://github.com/michaelfaith/eslint-plugin-package-json/commit/f3ea3e6ad7de445449ccfab8fb2472b382b600d5))
24
+ * add `require-os` rule ([#1632](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1632)) ([9b5e25d](https://github.com/michaelfaith/eslint-plugin-package-json/commit/9b5e25dad3d2e5af5882d706d52bce99de0f63b5))
25
+ * add `require-private` rule ([#1630](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1630)) ([770cc51](https://github.com/michaelfaith/eslint-plugin-package-json/commit/770cc51bdfe93782ae67ddb3183250c0afe33a3d))
26
+ * add `require-publishConfig` rule ([#1629](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1629)) ([ebc187a](https://github.com/michaelfaith/eslint-plugin-package-json/commit/ebc187ae5bde43c7b1f3f27eadfdeea2e67917a9))
27
+
3
28
  ## [0.89.3](https://github.com/michaelfaith/eslint-plugin-package-json/compare/v0.89.2...v0.89.3) (2026-03-04)
4
29
 
5
30
 
package/README.md CHANGED
@@ -228,10 +228,14 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
228
228
  | [require-homepage](docs/rules/require-homepage.md) | Requires the `homepage` property to be present. | | | | |
229
229
  | [require-keywords](docs/rules/require-keywords.md) | Requires the `keywords` property to be present. | | | | |
230
230
  | [require-license](docs/rules/require-license.md) | Requires the `license` property to be present. | ✔️ ✅ 📦 | | | |
231
+ | [require-main](docs/rules/require-main.md) | Requires the `main` property to be present. | | | | |
231
232
  | [require-name](docs/rules/require-name.md) | Requires the `name` property to be present. | ✔️ ✅ 📦 | | | |
232
233
  | [require-optionalDependencies](docs/rules/require-optionalDependencies.md) | Requires the `optionalDependencies` property to be present. | | | | |
234
+ | [require-os](docs/rules/require-os.md) | Requires the `os` property to be present. | | | | |
233
235
  | [require-packageManager](docs/rules/require-packageManager.md) | Requires the `packageManager` property to be present. | | | | |
234
236
  | [require-peerDependencies](docs/rules/require-peerDependencies.md) | Requires the `peerDependencies` property to be present. | | | | |
237
+ | [require-private](docs/rules/require-private.md) | Requires the `private` property to be present. | | 🔧 | | |
238
+ | [require-publishConfig](docs/rules/require-publishConfig.md) | Requires the `publishConfig` property to be present. | | | | |
235
239
  | [require-repository](docs/rules/require-repository.md) | Requires the `repository` property to be present. | ✔️ ✅ 📦 | | | |
236
240
  | [require-scripts](docs/rules/require-scripts.md) | Requires the `scripts` property to be present. | | | | |
237
241
  | [require-sideEffects](docs/rules/require-sideEffects.md) | Requires the `sideEffects` property to be present. | ✔️ ✅ 📦 | | | |
@@ -246,6 +250,7 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
246
250
  | [unique-dependencies](docs/rules/unique-dependencies.md) | Checks a dependency isn't specified more than once (i.e. in `dependencies` and `devDependencies`) | ✔️ ✅ 📦 | | 💡 | |
247
251
  | [valid-author](docs/rules/valid-author.md) | Enforce that the `author` property is valid. | ✔️ ✅ 📦 | | | |
248
252
  | [valid-bin](docs/rules/valid-bin.md) | Enforce that the `bin` property is valid. | ✔️ ✅ 📦 | | | |
253
+ | [valid-bugs](docs/rules/valid-bugs.md) | Enforce that the `bugs` property is valid. | ✔️ ✅ 📦 | | | |
249
254
  | [valid-bundleDependencies](docs/rules/valid-bundleDependencies.md) | Enforce that the `bundleDependencies` (also: `bundledDependencies`) property is valid. | ✔️ ✅ 📦 | | | |
250
255
  | [valid-config](docs/rules/valid-config.md) | Enforce that the `config` property is valid. | ✔️ ✅ 📦 | | | |
251
256
  | [valid-contributors](docs/rules/valid-contributors.md) | Enforce that the `contributors` property is valid. | ✔️ ✅ 📦 | | | |
@@ -257,6 +262,7 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
257
262
  | [valid-engines](docs/rules/valid-engines.md) | Enforce that the `engines` property is valid. | ✔️ ✅ 📦 | | | |
258
263
  | [valid-exports](docs/rules/valid-exports.md) | Enforce that the `exports` property is valid. | ✔️ ✅ 📦 | | | |
259
264
  | [valid-files](docs/rules/valid-files.md) | Enforce that the `files` property is valid. | ✔️ ✅ 📦 | | | |
265
+ | [valid-funding](docs/rules/valid-funding.md) | Enforce that the `funding` property is valid. | ✔️ ✅ 📦 | | | |
260
266
  | [valid-homepage](docs/rules/valid-homepage.md) | Enforce that the `homepage` property is valid. | ✔️ ✅ 📦 | | | |
261
267
  | [valid-keywords](docs/rules/valid-keywords.md) | Enforce that the `keywords` property is valid. | ✔️ ✅ 📦 | | | |
262
268
  | [valid-license](docs/rules/valid-license.md) | Enforce that the `license` property is valid. | ✔️ ✅ 📦 | | | |
@@ -267,6 +273,7 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
267
273
  | [valid-optionalDependencies](docs/rules/valid-optionalDependencies.md) | Enforce that the `optionalDependencies` property is valid. | ✔️ ✅ 📦 | | | |
268
274
  | [valid-os](docs/rules/valid-os.md) | Enforce that the `os` property is valid. | ✔️ ✅ 📦 | | | |
269
275
  | [valid-package-definition](docs/rules/valid-package-definition.md) | Enforce that package.json has all properties required by the npm spec | | | | ❌ |
276
+ | [valid-packageManager](docs/rules/valid-packageManager.md) | Enforce that the `packageManager` property is valid. | ✔️ ✅ 📦 | | | |
270
277
  | [valid-peerDependencies](docs/rules/valid-peerDependencies.md) | Enforce that the `peerDependencies` property is valid. | ✔️ ✅ 📦 | | | |
271
278
  | [valid-private](docs/rules/valid-private.md) | Enforce that the `private` property is valid. | ✔️ ✅ 📦 | | | |
272
279
  | [valid-publishConfig](docs/rules/valid-publishConfig.md) | Enforce that the `publishConfig` property is valid. | ✔️ ✅ 📦 | | | |
@@ -1,5 +1,4 @@
1
1
  import { isPackageJson } from "./utils/isPackageJson.mjs";
2
-
3
2
  //#region src/createRule.ts
4
3
  /**
5
4
  * Rule options type is inferred from the JSON schema by [json-schema-to-ts](https://www.npmjs.com/package/json-schema-to-ts).
@@ -20,6 +19,5 @@ function createRule(rule) {
20
19
  }
21
20
  };
22
21
  }
23
-
24
22
  //#endregion
25
- export { createRule };
23
+ export { createRule };
package/lib/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import { JSONSchema } from "./node_modules/.pnpm/json-schema-to-ts@3.1.1/node_mo
2
2
  import { PackageJsonPluginSettings, PackageJsonRuleModule } from "./createRule.mjs";
3
3
  import { plugin } from "./plugin.mjs";
4
4
  import * as jsonc_eslint_parser0 from "jsonc-eslint-parser";
5
- import * as eslint0 from "eslint";
5
+ import * as eslint from "eslint";
6
6
 
7
7
  //#region src/index.d.ts
8
8
  declare const rules: Record<string, PackageJsonRuleModule<unknown[], JSONSchema[]>>;
@@ -20,7 +20,7 @@ declare const configs: {
20
20
  };
21
21
  name: string;
22
22
  plugins: {
23
- readonly "package-json": eslint0.ESLint.Plugin;
23
+ readonly "package-json": eslint.ESLint.Plugin;
24
24
  };
25
25
  rules: {
26
26
  [k: string]: "error";
@@ -33,7 +33,7 @@ declare const configs: {
33
33
  };
34
34
  name: string;
35
35
  plugins: {
36
- readonly "package-json": eslint0.ESLint.Plugin;
36
+ readonly "package-json": eslint.ESLint.Plugin;
37
37
  };
38
38
  rules: {
39
39
  [x: string]: "error";
@@ -46,7 +46,7 @@ declare const configs: {
46
46
  };
47
47
  name: string;
48
48
  plugins: {
49
- readonly "package-json": eslint0.ESLint.Plugin;
49
+ readonly "package-json": eslint.ESLint.Plugin;
50
50
  };
51
51
  rules: {
52
52
  [k: string]: "error";
package/lib/index.mjs CHANGED
@@ -1,9 +1,7 @@
1
1
  import { plugin } from "./plugin.mjs";
2
-
3
2
  //#region src/index.ts
4
3
  const rules = plugin.rules;
5
4
  const configs = plugin.configs;
6
5
  var src_default = plugin;
7
-
8
6
  //#endregion
9
- export { configs, src_default as default, rules };
7
+ export { configs, src_default as default, rules };
package/lib/plugin.mjs CHANGED
@@ -20,7 +20,6 @@ import { rule as rule$16 } from "./rules/valid-repository-directory.mjs";
20
20
  import { rule as rule$17 } from "./rules/valid-version.mjs";
21
21
  import { createRequire } from "node:module";
22
22
  import * as parserJsonc from "jsonc-eslint-parser";
23
-
24
23
  //#region src/plugin.ts
25
24
  const require = createRequire(import.meta.url);
26
25
  const rules = {
@@ -92,6 +91,5 @@ const plugin = {
92
91
  },
93
92
  rules
94
93
  };
95
-
96
94
  //#endregion
97
- export { plugin };
95
+ export { plugin };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { kebabCase } from "change-case";
3
-
4
3
  //#region src/rules/bin-name-casing.ts
5
4
  const rule = createRule({
6
5
  create(context) {
@@ -38,6 +37,5 @@ const rule = createRule({
38
37
  },
39
38
  name: "bin-name-casing"
40
39
  });
41
-
42
40
  //#endregion
43
- export { rule };
41
+ export { rule };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { isJSONStringLiteral } from "../utils/predicates.mjs";
3
-
4
3
  //#region src/rules/exports-subpaths-style.ts
5
4
  function isImplicitFormat(node) {
6
5
  if (node.type === "JSONLiteral") return true;
@@ -68,6 +67,5 @@ const rule = createRule({
68
67
  },
69
68
  name: "exports-subpaths-style"
70
69
  });
71
-
72
70
  //#endregion
73
- export { rule };
71
+ export { rule };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { fixRemoveArrayElement, fixRemoveObjectProperty } from "eslint-fix-utils";
3
-
4
3
  //#region src/rules/no-empty-fields.ts
5
4
  const getDataAndMessageId = (node) => {
6
5
  switch (node.type) {
@@ -86,6 +85,5 @@ const rule = createRule({
86
85
  },
87
86
  name: "no-empty-fields"
88
87
  });
89
-
90
88
  //#endregion
91
- export { rule };
89
+ export { rule };
@@ -1,7 +1,6 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { isJSONStringLiteral, isNotNullish } from "../utils/predicates.mjs";
3
3
  import { fixRemoveArrayElement } from "eslint-fix-utils";
4
-
5
4
  //#region src/rules/no-redundant-files.ts
6
5
  const defaultFiles = [
7
6
  /^(\.\/)?LICEN(C|S)E(\.|$)/i,
@@ -97,6 +96,5 @@ const rule = createRule({
97
96
  },
98
97
  name: "no-redundant-files"
99
98
  });
100
-
101
99
  //#endregion
102
- export { rule };
100
+ export { rule };
@@ -1,7 +1,6 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { isJSONStringLiteral } from "../utils/predicates.mjs";
3
3
  import { fixRemoveObjectProperty } from "eslint-fix-utils";
4
-
5
4
  //#region src/rules/no-redundant-publishConfig.ts
6
5
  const rule = createRule({
7
6
  create(context) {
@@ -47,6 +46,5 @@ const rule = createRule({
47
46
  },
48
47
  name: "no-redundant-publishConfig"
49
48
  });
50
-
51
49
  //#endregion
52
- export { rule };
50
+ export { rule };
@@ -3,7 +3,6 @@ import detectIndent from "detect-indent";
3
3
  import { detectNewlineGraceful } from "detect-newline";
4
4
  import sortObjectKeys from "sort-object-keys";
5
5
  import { sortOrder } from "sort-package-json";
6
-
7
6
  //#region src/rules/order-properties.ts
8
7
  const standardOrderLegacy = [
9
8
  "name",
@@ -93,6 +92,5 @@ const rule = createRule({
93
92
  },
94
93
  name: "order-properties"
95
94
  });
96
-
97
95
  //#endregion
98
- export { rule };
96
+ export { rule };
@@ -1,7 +1,6 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { isJSONStringLiteral } from "../utils/predicates.mjs";
3
3
  import { findPropertyWithKeyValue } from "../utils/findPropertyWithKeyValue.mjs";
4
-
5
4
  //#region src/rules/repository-shorthand.ts
6
5
  const providerRegexes = {
7
6
  bitbucket: /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?bitbucket\.org\//,
@@ -108,6 +107,5 @@ const rule = createRule({
108
107
  },
109
108
  name: "repository-shorthand"
110
109
  });
111
-
112
110
  //#endregion
113
- export { rule };
111
+ export { rule };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { fixRemoveObjectProperty } from "eslint-fix-utils";
3
-
4
3
  //#region src/rules/require-attribution.ts
5
4
  const rule = createRule({
6
5
  create(context) {
@@ -82,6 +81,5 @@ const rule = createRule({
82
81
  },
83
82
  name: "require-attribution"
84
83
  });
85
-
86
84
  //#endregion
87
- export { rule };
85
+ export { rule };
@@ -4,9 +4,9 @@ import { CreateRequirePropertyRuleOptions } from "../utils/createSimpleRequirePr
4
4
  //#region src/rules/require-properties.d.ts
5
5
  declare const propertyConfig: [name: string, options?: CreateRequirePropertyRuleOptions][];
6
6
  declare const rules: {
7
- [k: string]: PackageJsonRuleModule<[({
7
+ [k: string]: PackageJsonRuleModule<[] | [({
8
8
  ignorePrivate: boolean;
9
- } | undefined)?], [{
9
+ } | undefined)?], [] | [{
10
10
  readonly additionalProperties: false;
11
11
  readonly properties: {
12
12
  readonly ignorePrivate: {
@@ -1,5 +1,4 @@
1
1
  import { createSimpleRequirePropertyRule } from "../utils/createSimpleRequirePropertyRule.mjs";
2
-
3
2
  //#region src/rules/require-properties.ts
4
3
  const propertyConfig = [
5
4
  ["author"],
@@ -23,13 +22,17 @@ const propertyConfig = [
23
22
  ignorePrivateDefault: true,
24
23
  isRecommended: true
25
24
  }],
25
+ ["main"],
26
26
  ["name", {
27
27
  ignorePrivateDefault: true,
28
28
  isRecommended: true
29
29
  }],
30
30
  ["optionalDependencies"],
31
+ ["os"],
31
32
  ["packageManager"],
32
33
  ["peerDependencies"],
34
+ ["private", { fixValue: false }],
35
+ ["publishConfig", { ignorePrivateDefault: true }],
33
36
  ["repository", {
34
37
  ignorePrivateDefault: true,
35
38
  isRecommended: true
@@ -53,6 +56,5 @@ const rules = Object.fromEntries(propertyConfig.map(([propertyName, options]) =>
53
56
  const { rule, ruleName } = createSimpleRequirePropertyRule(propertyName, options);
54
57
  return [ruleName, rule];
55
58
  }));
56
-
57
59
  //#endregion
58
- export { propertyConfig, rules };
60
+ export { propertyConfig, rules };
@@ -1,7 +1,6 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { isJSONStringLiteral } from "../utils/predicates.mjs";
3
3
  import semver from "semver";
4
-
5
4
  //#region src/rules/restrict-dependency-ranges.ts
6
5
  const DEPENDENCY_TYPES = [
7
6
  "dependencies",
@@ -144,6 +143,5 @@ const rule = createRule({
144
143
  },
145
144
  name: "restrict-dependency-ranges"
146
145
  });
147
-
148
146
  //#endregion
149
- export { rule };
147
+ export { rule };
@@ -1,7 +1,6 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { isJSONStringLiteral } from "../utils/predicates.mjs";
3
3
  import { fixRemoveObjectProperty } from "eslint-fix-utils";
4
-
5
4
  //#region src/rules/restrict-private-properties.ts
6
5
  const defaultBlockedProperties = ["files", "publishConfig"];
7
6
  const rule = createRule({
@@ -50,6 +49,5 @@ const rule = createRule({
50
49
  },
51
50
  name: "restrict-private-properties"
52
51
  });
53
-
54
52
  //#endregion
55
- export { rule };
53
+ export { rule };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { kebabCase } from "change-case";
3
-
4
3
  //#region src/rules/scripts-name-casing.ts
5
4
  const BUILT_IN_SCRIPTS_IN_CAMEL_CASE = new Set(["prepublishOnly"]);
6
5
  const rule = createRule({
@@ -41,6 +40,5 @@ const rule = createRule({
41
40
  },
42
41
  name: "scripts-name-casing"
43
42
  });
44
-
45
43
  //#endregion
46
- export { rule };
44
+ export { rule };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import sortPackageJson from "sort-package-json";
3
-
4
3
  //#region src/rules/sort-collections.ts
5
4
  const defaultCollections = new Set([
6
5
  "config",
@@ -69,6 +68,5 @@ const rule = createRule({
69
68
  },
70
69
  name: "sort-collections"
71
70
  });
72
-
73
71
  //#endregion
74
- export { rule };
72
+ export { rule };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { isJSONStringLiteral } from "../utils/predicates.mjs";
3
-
4
3
  //#region src/rules/specify-peers-locally.ts
5
4
  const rule = createRule({
6
5
  create(context) {
@@ -60,6 +59,5 @@ const rule = createRule({
60
59
  },
61
60
  name: "specify-peers-locally"
62
61
  });
63
-
64
62
  //#endregion
65
- export { rule };
63
+ export { rule };
@@ -1,7 +1,6 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { isJSONStringLiteral, isNotNullish } from "../utils/predicates.mjs";
3
3
  import { fixRemoveArrayElement, fixRemoveObjectProperty } from "eslint-fix-utils";
4
-
5
4
  //#region src/rules/unique-dependencies.ts
6
5
  const dependencyPropertyNames = new Set([
7
6
  "bundledDependencies",
@@ -83,6 +82,5 @@ const rule = createRule({
83
82
  },
84
83
  name: "unique-dependencies"
85
84
  });
86
-
87
85
  //#endregion
88
- export { rule };
86
+ export { rule };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import validate from "validate-npm-package-name";
3
-
4
3
  //#region src/rules/valid-name.ts
5
4
  const rule = createRule({
6
5
  create(context) {
@@ -39,6 +38,5 @@ const rule = createRule({
39
38
  },
40
39
  name: "valid-name"
41
40
  });
42
-
43
41
  //#endregion
44
- export { rule };
42
+ export { rule };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { validate } from "package-json-validator";
3
-
4
3
  //#region src/rules/valid-package-definition.ts
5
4
  const ignoredErrors = [
6
5
  /^Url not valid/i,
@@ -41,6 +40,5 @@ const rule = createRule({
41
40
  },
42
41
  name: "valid-package-definition"
43
42
  });
44
-
45
43
  //#endregion
46
- export { rule };
44
+ export { rule };
@@ -1,10 +1,10 @@
1
1
  import { createSimpleValidPropertyRule } from "../utils/createSimpleValidPropertyRule.mjs";
2
- import { validateAuthor, validateBin, validateBundleDependencies, validateConfig, validateContributors, validateCpu, validateDependencies, validateDescription, validateDirectories, validateEngines, validateExports, validateFiles, validateHomepage, validateKeywords, validateLicense, validateMain, validateMan, validateOs, validatePrivate, validatePublishConfig, validateRepository, validateScripts, validateSideEffects, validateType, validateWorkspaces } from "package-json-validator";
3
-
2
+ import { validateAuthor, validateBin, validateBugs, validateBundleDependencies, validateConfig, validateContributors, validateCpu, validateDependencies, validateDescription, validateDirectories, validateEngines, validateExports, validateFiles, validateFunding, validateHomepage, validateKeywords, validateLicense, validateMain, validateMan, validateOs, validatePackageManager, validatePrivate, validatePublishConfig, validateRepository, validateScripts, validateSideEffects, validateType, validateWorkspaces } from "package-json-validator";
4
3
  //#region src/rules/valid-properties.ts
5
4
  const properties = [
6
5
  ["author", validateAuthor],
7
6
  ["bin", validateBin],
7
+ ["bugs", validateBugs],
8
8
  ["bundleDependencies", {
9
9
  aliases: ["bundledDependencies"],
10
10
  validator: validateBundleDependencies
@@ -19,6 +19,7 @@ const properties = [
19
19
  ["engines", validateEngines],
20
20
  ["exports", validateExports],
21
21
  ["files", validateFiles],
22
+ ["funding", validateFunding],
22
23
  ["homepage", validateHomepage],
23
24
  ["keywords", validateKeywords],
24
25
  ["license", validateLicense],
@@ -27,6 +28,7 @@ const properties = [
27
28
  ["module", validateMain],
28
29
  ["optionalDependencies", validateDependencies],
29
30
  ["os", validateOs],
31
+ ["packageManager", validatePackageManager],
30
32
  ["peerDependencies", validateDependencies],
31
33
  ["private", validatePrivate],
32
34
  ["publishConfig", validatePublishConfig],
@@ -47,6 +49,5 @@ const rules = Object.fromEntries(properties.map(([propertyName, validationFuncti
47
49
  const { rule, ruleName } = createSimpleValidPropertyRule(propertyName, validationFunction, aliases);
48
50
  return [ruleName, rule];
49
51
  }));
50
-
51
52
  //#endregion
52
- export { rules };
53
+ export { rules };
@@ -3,7 +3,6 @@ import { findPropertyWithKeyValue } from "../utils/findPropertyWithKeyValue.mjs"
3
3
  import { findRootSync } from "@altano/repository-tools";
4
4
  import path from "node:path";
5
5
  import { sep } from "node:path/posix";
6
-
7
6
  //#region src/rules/valid-repository-directory.ts
8
7
  /**
9
8
  * Checks if the child path appears at the end of the parent path.
@@ -66,6 +65,5 @@ const rule = createRule({
66
65
  },
67
66
  name: "valid-repository-directory"
68
67
  });
69
-
70
68
  //#endregion
71
- export { rule };
69
+ export { rule };
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import semver from "semver";
3
-
4
3
  //#region src/rules/valid-version.ts
5
4
  const rule = createRule({
6
5
  create(context) {
@@ -33,6 +32,5 @@ const rule = createRule({
33
32
  },
34
33
  name: "valid-version"
35
34
  });
36
-
37
35
  //#endregion
38
- export { rule };
36
+ export { rule };
@@ -29,9 +29,9 @@ declare const createSimpleRequirePropertyRule: (propertyName: string, {
29
29
  ignorePrivateDefault,
30
30
  isRecommended
31
31
  }?: CreateRequirePropertyRuleOptions) => {
32
- rule: PackageJsonRuleModule<[({
32
+ rule: PackageJsonRuleModule<[] | [({
33
33
  ignorePrivate: boolean;
34
- } | undefined)?], [{
34
+ } | undefined)?], [] | [{
35
35
  readonly additionalProperties: false;
36
36
  readonly properties: {
37
37
  readonly ignorePrivate: {
@@ -1,6 +1,5 @@
1
1
  import { createRule } from "../createRule.mjs";
2
2
  import { isJSONStringLiteral } from "./predicates.mjs";
3
-
4
3
  //#region src/utils/createSimpleRequirePropertyRule.ts
5
4
  /**
6
5
  * Given a top-level property name, create a rule that requires that property to be present.
@@ -36,7 +35,7 @@ const createSimpleRequirePropertyRule = (propertyName, { category, fixValue, ign
36
35
  },
37
36
  fixable: fixValue === void 0 ? void 0 : "code",
38
37
  messages: { missing: "Property '{{property}}' is required." },
39
- schema: [{
38
+ schema: propertyName === "private" ? [] : [{
40
39
  additionalProperties: false,
41
40
  properties: { ignorePrivate: {
42
41
  default: ignorePrivateDefault,
@@ -52,6 +51,5 @@ const createSimpleRequirePropertyRule = (propertyName, { category, fixValue, ign
52
51
  ruleName
53
52
  };
54
53
  };
55
-
56
54
  //#endregion
57
- export { createSimpleRequirePropertyRule };
55
+ export { createSimpleRequirePropertyRule };
@@ -1,5 +1,4 @@
1
1
  import { createRule } from "../createRule.mjs";
2
-
3
2
  //#region src/utils/createSimpleValidPropertyRule.ts
4
3
  /**
5
4
  * Given a top-level property name, and a validation function, create a rule that validates the property using the validation function.
@@ -53,6 +52,5 @@ const createSimpleValidPropertyRule = (propertyName, validationFunction, aliases
53
52
  ruleName
54
53
  };
55
54
  };
56
-
57
55
  //#endregion
58
- export { createSimpleValidPropertyRule };
56
+ export { createSimpleValidPropertyRule };
@@ -2,6 +2,5 @@
2
2
  function findPropertyWithKeyValue(properties, value) {
3
3
  return properties.find((property) => property.key.type === "JSONLiteral" && property.key.value === value);
4
4
  }
5
-
6
5
  //#endregion
7
- export { findPropertyWithKeyValue };
6
+ export { findPropertyWithKeyValue };
@@ -8,6 +8,5 @@ const formatErrors = (errors) => {
8
8
  if (errors.length === 0) return "";
9
9
  return errors.length > 1 ? ["", ...errors].join("\n - ") : errors[0];
10
10
  };
11
-
12
11
  //#endregion
13
- export { formatErrors };
12
+ export { formatErrors };
@@ -1,5 +1,4 @@
1
1
  //#region src/utils/isPackageJson.ts
2
2
  const isPackageJson = (filePath) => /(?:^|[/\\])package.json$/.test(filePath);
3
-
4
3
  //#endregion
5
- export { isPackageJson };
4
+ export { isPackageJson };
@@ -5,6 +5,5 @@ function isJSONStringLiteral(node) {
5
5
  function isNotNullish(value) {
6
6
  return value !== null && value !== void 0;
7
7
  }
8
-
9
8
  //#endregion
10
- export { isJSONStringLiteral, isNotNullish };
9
+ export { isJSONStringLiteral, isNotNullish };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-package-json",
3
- "version": "0.89.3",
3
+ "version": "0.90.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": {
@@ -49,30 +49,30 @@
49
49
  "detect-indent": "^7.0.2",
50
50
  "detect-newline": "^4.0.1",
51
51
  "eslint-fix-utils": "~0.4.1",
52
- "package-json-validator": "^1.0.1",
52
+ "package-json-validator": "^1.2.1",
53
53
  "semver": "^7.7.3",
54
54
  "sort-object-keys": "^2.0.0",
55
55
  "sort-package-json": "^3.4.0",
56
56
  "validate-npm-package-name": "^7.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@eslint-community/eslint-plugin-eslint-comments": "4.6.0",
59
+ "@eslint-community/eslint-plugin-eslint-comments": "4.7.0",
60
60
  "@eslint/js": "10.0.1",
61
61
  "@eslint/markdown": "7.5.1",
62
62
  "@types/estree": "1.0.8",
63
- "@types/node": "24.11.0",
63
+ "@types/node": "24.12.0",
64
64
  "@types/semver": "7.7.1",
65
65
  "@types/validate-npm-package-name": "4.0.2",
66
66
  "@vitest/coverage-v8": "4.0.13",
67
67
  "@vitest/eslint-plugin": "1.6.1",
68
68
  "console-fail-test": "0.6.0",
69
69
  "eslint": "10.0.0",
70
- "eslint-doc-generator": "3.2.0",
70
+ "eslint-doc-generator": "3.3.1",
71
71
  "eslint-plugin-eslint-plugin": "7.3.1",
72
72
  "eslint-plugin-jsdoc": "62.7.0",
73
73
  "eslint-plugin-jsonc": "3.1.0",
74
74
  "eslint-plugin-n": "17.24.0",
75
- "eslint-plugin-node-dependencies": "2.1.0",
75
+ "eslint-plugin-node-dependencies": "2.2.0",
76
76
  "eslint-plugin-perfectionist": "5.6.0",
77
77
  "eslint-plugin-regexp": "3.0.0",
78
78
  "eslint-plugin-unicorn": "63.0.0",
@@ -88,7 +88,7 @@
88
88
  "prettier-plugin-packagejson": "3.0.0",
89
89
  "prettier-plugin-sentences-per-line": "0.2.3",
90
90
  "prettier-plugin-sh": "0.18.0",
91
- "tsdown": "0.20.0",
91
+ "tsdown": "0.21.0",
92
92
  "typescript": "5.9.3",
93
93
  "typescript-eslint": "8.56.0",
94
94
  "vitest": "4.0.13"