eslint-plugin-package-json 0.88.3 → 0.89.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.89.0](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.88.3...v0.89.0) (2026-02-20)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * move the `publishable` require rules to `recommended` ([#1565](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1565))
9
+
10
+ ### 🚀 Features
11
+
12
+ * add support for eslint v10 ([#1554](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1554)) ([27ca725](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/27ca725ac5418f5b4076a5890876bd51e3e90d34))
13
+ * move the `publishable` require rules to `recommended` ([#1565](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1565)) ([37231d3](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/37231d321aff449912b6013b8d6ead78caff3695))
14
+
3
15
  ## [0.88.3](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.88.2...v0.88.3) (2026-02-16)
4
16
 
5
17
 
package/README.md CHANGED
@@ -66,6 +66,10 @@ See [ESLint's _Configuration Files_ guide](https://eslint.org/docs/latest/use/co
66
66
 
67
67
  ### Recommended Config for Publishable Packages
68
68
 
69
+ > [!NOTE]
70
+ > This config was recently made redundant and is now the same as `recommended`.
71
+ > However, we're keeping it as its own config for now, in the event that we add new rules unique to the publishable use case.
72
+
69
73
  The `recommended-publishable` configuration has everything in it from the standard `recommended` config, with some additional rules added that are geared towards packages that are intended to be published.
70
74
 
71
75
  ```ts
@@ -211,7 +215,7 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
211
215
  | [no-redundant-publishConfig](docs/rules/no-redundant-publishConfig.md) | Warns when publishConfig.access is used in unscoped packages. | ✔️ ✅ 📦 | | 💡 | |
212
216
  | [order-properties](docs/rules/order-properties.md) | Package properties should be declared in standard order | 🎨 | 🔧 | | |
213
217
  | [repository-shorthand](docs/rules/repository-shorthand.md) | Enforce either object or shorthand declaration for repository. | ✔️ ✅ 📦 | 🔧 | | |
214
- | [require-attribution](docs/rules/require-attribution.md) | Ensures that proper attribution is included, requiring that either `author` or `contributors` is defined, and that if `contributors` is present, it should include at least one contributor. | 📦 | | 💡 | |
218
+ | [require-attribution](docs/rules/require-attribution.md) | Ensures that proper attribution is included, requiring that either `author` or `contributors` is defined, and that if `contributors` is present, it should include at least one contributor. | ✔️ ✅ 📦 | | 💡 | |
215
219
  | [require-author](docs/rules/require-author.md) | Requires the `author` property to be present. | | | | |
216
220
  | [require-bugs](docs/rules/require-bugs.md) | Requires the `bugs` property to be present. | | | | |
217
221
  | [require-bundleDependencies](docs/rules/require-bundleDependencies.md) | Requires the `bundleDependencies` property to be present. | | | | |
@@ -219,17 +223,17 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
219
223
  | [require-description](docs/rules/require-description.md) | Requires the `description` property to be present. | ✔️ ✅ 📦 | | | |
220
224
  | [require-devDependencies](docs/rules/require-devDependencies.md) | Requires the `devDependencies` property to be present. | | | | |
221
225
  | [require-engines](docs/rules/require-engines.md) | Requires the `engines` property to be present. | | | | |
222
- | [require-exports](docs/rules/require-exports.md) | Requires the `exports` property to be present. | 📦 | | | |
223
- | [require-files](docs/rules/require-files.md) | Requires the `files` property to be present. | 📦 | | | |
226
+ | [require-exports](docs/rules/require-exports.md) | Requires the `exports` property to be present. | ✔️ ✅ 📦 | | | |
227
+ | [require-files](docs/rules/require-files.md) | Requires the `files` property to be present. | ✔️ ✅ 📦 | | | |
224
228
  | [require-homepage](docs/rules/require-homepage.md) | Requires the `homepage` property to be present. | | | | |
225
229
  | [require-keywords](docs/rules/require-keywords.md) | Requires the `keywords` property to be present. | | | | |
226
230
  | [require-license](docs/rules/require-license.md) | Requires the `license` property to be present. | ✔️ ✅ 📦 | | | |
227
231
  | [require-name](docs/rules/require-name.md) | Requires the `name` property to be present. | ✔️ ✅ 📦 | | | |
228
232
  | [require-optionalDependencies](docs/rules/require-optionalDependencies.md) | Requires the `optionalDependencies` property to be present. | | | | |
229
233
  | [require-peerDependencies](docs/rules/require-peerDependencies.md) | Requires the `peerDependencies` property to be present. | | | | |
230
- | [require-repository](docs/rules/require-repository.md) | Requires the `repository` property to be present. | 📦 | | | |
234
+ | [require-repository](docs/rules/require-repository.md) | Requires the `repository` property to be present. | ✔️ ✅ 📦 | | | |
231
235
  | [require-scripts](docs/rules/require-scripts.md) | Requires the `scripts` property to be present. | | | | |
232
- | [require-sideEffects](docs/rules/require-sideEffects.md) | Requires the `sideEffects` property to be present. | 📦 | | | |
236
+ | [require-sideEffects](docs/rules/require-sideEffects.md) | Requires the `sideEffects` property to be present. | ✔️ ✅ 📦 | | | |
233
237
  | [require-type](docs/rules/require-type.md) | Requires the `type` property to be present. | ✔️ ✅ 📦 | 🔧 | | |
234
238
  | [require-types](docs/rules/require-types.md) | Requires the `types` property to be present. | | | | |
235
239
  | [require-version](docs/rules/require-version.md) | Requires the `version` property to be present. | ✔️ ✅ 📦 | | | |
@@ -35,8 +35,11 @@ interface PackageJsonRuleContext<Options extends unknown[] = unknown[]> extends
35
35
  }
36
36
  interface PackageJsonRuleModule<Options extends unknown[] = unknown[], Schema extends JSONSchema[] = JSONSchema[]> {
37
37
  create(context: PackageJsonRuleContext<Options>): RuleListener;
38
- meta: Omit<Rule.RuleMetaData, "defaultOptions" | "schema"> & {
38
+ meta: Omit<Rule.RuleMetaData, "defaultOptions" | "docs" | "schema"> & {
39
39
  defaultOptions?: NoInfer<Options>;
40
+ docs?: Rule.RuleMetaData["docs"] & {
41
+ category?: string;
42
+ };
40
43
  schema?: Schema;
41
44
  };
42
45
  }
@@ -69,8 +69,8 @@ const rule = createRule({
69
69
  },
70
70
  hasSuggestions: true,
71
71
  messages: {
72
- emptyExpression: "This {{expressionType}} does nothing and can be removed.",
73
- emptyFields: "The field '{{field}}' does nothing and can be removed.",
72
+ emptyExpression: "This {{ expressionType }} does nothing and can be removed.",
73
+ emptyFields: "The field '{{ field }}' does nothing and can be removed.",
74
74
  remove: "Remove this empty field."
75
75
  },
76
76
  schema: [{
@@ -5,7 +5,7 @@ import { fixRemoveObjectProperty } from "eslint-fix-utils";
5
5
  const rule = createRule({
6
6
  create(context) {
7
7
  const preferContributorsOnly = context.options[0]?.preferContributorsOnly ?? false;
8
- const ignorePrivate = context.options[0]?.ignorePrivate ?? false;
8
+ const ignorePrivate = context.options[0]?.ignorePrivate ?? true;
9
9
  let authorPropertyNode;
10
10
  let contributorsPropertyNode;
11
11
  let isPrivatePackage = false;
@@ -48,12 +48,13 @@ const rule = createRule({
48
48
  },
49
49
  meta: {
50
50
  defaultOptions: [{
51
- ignorePrivate: false,
51
+ ignorePrivate: true,
52
52
  preferContributorsOnly: false
53
53
  }],
54
54
  docs: {
55
- category: "Publishable",
56
- description: "Ensures that proper attribution is included, requiring that either `author` or `contributors` is defined, and that if `contributors` is present, it should include at least one contributor."
55
+ category: "Best Practices",
56
+ description: "Ensures that proper attribution is included, requiring that either `author` or `contributors` is defined, and that if `contributors` is present, it should include at least one contributor.",
57
+ recommended: true
57
58
  },
58
59
  hasSuggestions: true,
59
60
  messages: {
@@ -9,8 +9,14 @@ const propertyConfig = [
9
9
  ["description", { isRecommended: true }],
10
10
  ["devDependencies"],
11
11
  ["engines"],
12
- ["exports", { category: "Publishable" }],
13
- ["files", { category: "Publishable" }],
12
+ ["exports", {
13
+ ignorePrivateDefault: true,
14
+ isRecommended: true
15
+ }],
16
+ ["files", {
17
+ ignorePrivateDefault: true,
18
+ isRecommended: true
19
+ }],
14
20
  ["homepage"],
15
21
  ["keywords"],
16
22
  ["license", {
@@ -24,11 +30,14 @@ const propertyConfig = [
24
30
  ["optionalDependencies"],
25
31
  ["peerDependencies"],
26
32
  ["repository", {
27
- category: "Publishable",
28
- ignorePrivateDefault: true
33
+ ignorePrivateDefault: true,
34
+ isRecommended: true
29
35
  }],
30
36
  ["scripts"],
31
- ["sideEffects", { category: "Publishable" }],
37
+ ["sideEffects", {
38
+ ignorePrivateDefault: true,
39
+ isRecommended: true
40
+ }],
32
41
  ["type", {
33
42
  fixValue: "commonjs",
34
43
  isRecommended: true
@@ -34,8 +34,8 @@ const rule = createRule({
34
34
  fixable: "code",
35
35
  hasSuggestions: true,
36
36
  messages: {
37
- removePropertySuggestion: "Remove the '{{property}}' field.",
38
- unnecessaryProperty: "The '{{property}}' field is unnecessary in private packages and can be removed."
37
+ removePropertySuggestion: "Remove the '{{ property }}' field.",
38
+ unnecessaryProperty: "The '{{ property }}' field is unnecessary in private packages and can be removed."
39
39
  },
40
40
  schema: [{
41
41
  additionalProperties: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-package-json",
3
- "version": "0.88.3",
3
+ "version": "0.89.0",
4
4
  "description": "Rules for consistent, readable, and valid package.json files. 🗂️",
5
5
  "homepage": "https://github.com/JoshuaKGoldberg/eslint-plugin-package-json#readme",
6
6
  "bugs": {
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@eslint-community/eslint-plugin-eslint-comments": "4.6.0",
60
- "@eslint/js": "9.39.1",
60
+ "@eslint/js": "10.0.1",
61
61
  "@eslint/markdown": "7.5.1",
62
62
  "@types/estree": "1.0.8",
63
63
  "@types/node": "24.10.1",
@@ -66,18 +66,18 @@
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
- "eslint": "9.39.1",
70
- "eslint-doc-generator": "3.0.2",
71
- "eslint-plugin-eslint-plugin": "7.3.0",
72
- "eslint-plugin-jsdoc": "62.5.0",
73
- "eslint-plugin-jsonc": "2.21.0",
69
+ "eslint": "10.0.0",
70
+ "eslint-doc-generator": "3.1.0",
71
+ "eslint-plugin-eslint-plugin": "7.3.1",
72
+ "eslint-plugin-jsdoc": "62.5.5",
73
+ "eslint-plugin-jsonc": "2.21.1",
74
74
  "eslint-plugin-markdown-links": "0.7.1",
75
- "eslint-plugin-n": "17.23.1",
75
+ "eslint-plugin-n": "17.24.0",
76
76
  "eslint-plugin-node-dependencies": "1.3.0",
77
77
  "eslint-plugin-perfectionist": "5.5.0",
78
78
  "eslint-plugin-regexp": "3.0.0",
79
79
  "eslint-plugin-unicorn": "63.0.0",
80
- "eslint-plugin-yml": "3.1.0",
80
+ "eslint-plugin-yml": "3.2.0",
81
81
  "husky": "9.1.7",
82
82
  "jiti": "2.6.1",
83
83
  "json-schema-to-ts": "3.1.1",
@@ -90,7 +90,7 @@
90
90
  "prettier-plugin-sh": "0.18.0",
91
91
  "tsdown": "0.20.0",
92
92
  "typescript": "5.9.3",
93
- "typescript-eslint": "8.55.0",
93
+ "typescript-eslint": "8.56.0",
94
94
  "vitest": "4.0.13"
95
95
  },
96
96
  "peerDependencies": {