eslint-plugin-package-json 0.65.0 → 0.65.2
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,16 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## [0.65.2](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.65.1...v0.65.2) (2025-11-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **valid-exports:** improve report precision ([#1361](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1361)) ([5d7bd4a](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/5d7bd4affb93c3eb22576062c963599b6e56bdd1)), closes [#000](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/000)
|
|
4
9
|
|
|
10
|
+
## [0.65.1](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.65.0...v0.65.1) (2025-11-09)
|
|
5
11
|
|
|
6
12
|
### Bug Fixes
|
|
7
13
|
|
|
8
|
-
|
|
14
|
+
- **scripts-name-casing:** ignore `prepublishOnly` built-in script ([#1369](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1369)) ([b672551](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/b67255122ac753d1c3f9d7ef310a72dca029f2a3)), closes [#1368](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1368)
|
|
15
|
+
|
|
16
|
+
# [0.65.0](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.64.0...v0.65.0) (2025-11-08)
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
9
19
|
|
|
20
|
+
- **valid-bin, valid-bundleDependencies:** improve report precision ([#1360](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1360)) ([3d0bd1e](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/3d0bd1e04b935d30e85823dcf8c8d682ea4ab8d2)), closes [#000](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/000)
|
|
10
21
|
|
|
11
22
|
### Features
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
- **no-redundant-publishConfig:** add new rule ([#1366](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1366)) ([8d3680c](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/8d3680c5fb0df0af37744cf86201163aee372bab)), closes [#1365](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1365)
|
|
14
25
|
|
|
15
26
|
# [0.64.0](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.63.0...v0.64.0) (2025-11-04)
|
|
16
27
|
|
|
@@ -2,20 +2,23 @@ import { createRule } from "../createRule.js";
|
|
|
2
2
|
import { kebabCase } from "change-case";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/scripts-name-casing.ts
|
|
5
|
+
const BUILT_IN_SCRIPTS_IN_CAMEL_CASE = new Set(["prepublishOnly"]);
|
|
5
6
|
const rule = createRule({
|
|
6
7
|
create(context) {
|
|
7
8
|
return { "Program > JSONExpressionStatement > JSONObjectExpression > JSONProperty[key.value=scripts]"(node) {
|
|
8
9
|
if (node.value.type === "JSONObjectExpression") for (const property of node.value.properties) {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
|
|
10
|
+
const keyNode = property.key;
|
|
11
|
+
const key = keyNode.value;
|
|
12
|
+
if (BUILT_IN_SCRIPTS_IN_CAMEL_CASE.has(key)) continue;
|
|
13
|
+
const kebabCaseKey = key.split(":").map((segment) => kebabCase(segment)).join(":");
|
|
14
|
+
if (kebabCaseKey !== key) context.report({
|
|
15
|
+
data: { property: key },
|
|
13
16
|
messageId: "invalidCase",
|
|
14
|
-
node:
|
|
17
|
+
node: keyNode,
|
|
15
18
|
suggest: [{
|
|
16
|
-
data: { property: key
|
|
19
|
+
data: { property: key },
|
|
17
20
|
fix: (fixer) => {
|
|
18
|
-
return fixer.replaceText(
|
|
21
|
+
return fixer.replaceText(keyNode, JSON.stringify(kebabCaseKey));
|
|
19
22
|
},
|
|
20
23
|
messageId: "convertToKebabCase"
|
|
21
24
|
}]
|
|
@@ -3,18 +3,11 @@ import { validateAuthor, validateBin, validateBundleDependencies, validateConfig
|
|
|
3
3
|
|
|
4
4
|
//#region src/rules/valid-properties.ts
|
|
5
5
|
const legacyProperties = [
|
|
6
|
-
["config", validateConfig],
|
|
7
|
-
["cpu", validateCpu],
|
|
8
6
|
["dependencies", validateDependencies],
|
|
9
|
-
["description", validateDescription],
|
|
10
7
|
["devDependencies", validateDependencies],
|
|
11
|
-
["directories", validateDirectories],
|
|
12
|
-
["exports", validateExports],
|
|
13
|
-
["license", validateLicense],
|
|
14
8
|
["optionalDependencies", validateDependencies],
|
|
15
9
|
["peerDependencies", validateDependencies],
|
|
16
|
-
["scripts", validateScripts]
|
|
17
|
-
["type", validateType]
|
|
10
|
+
["scripts", validateScripts]
|
|
18
11
|
];
|
|
19
12
|
const legacyRules = Object.fromEntries(legacyProperties.map(([propertyName, validationFunction]) => {
|
|
20
13
|
const { rule, ruleName } = createLegacySimpleValidPropertyRule(propertyName, validationFunction);
|
|
@@ -26,7 +19,14 @@ const properties = [
|
|
|
26
19
|
["bundleDependencies", {
|
|
27
20
|
aliases: ["bundledDependencies"],
|
|
28
21
|
validator: validateBundleDependencies
|
|
29
|
-
}]
|
|
22
|
+
}],
|
|
23
|
+
["config", validateConfig],
|
|
24
|
+
["cpu", validateCpu],
|
|
25
|
+
["description", validateDescription],
|
|
26
|
+
["directories", validateDirectories],
|
|
27
|
+
["exports", validateExports],
|
|
28
|
+
["license", validateLicense],
|
|
29
|
+
["type", validateType]
|
|
30
30
|
];
|
|
31
31
|
/** All basic valid- flavor rules */
|
|
32
32
|
const rules = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-package-json",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.2",
|
|
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": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"detect-indent": "^7.0.2",
|
|
49
49
|
"detect-newline": "^4.0.1",
|
|
50
50
|
"eslint-fix-utils": "~0.4.0",
|
|
51
|
-
"package-json-validator": "~0.
|
|
51
|
+
"package-json-validator": "~0.42.0",
|
|
52
52
|
"semver": "^7.7.3",
|
|
53
53
|
"sort-object-keys": "^2.0.0",
|
|
54
54
|
"sort-package-json": "^3.4.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"jiti": "2.6.0",
|
|
79
79
|
"json-schema-to-ts": "3.1.1",
|
|
80
80
|
"jsonc-eslint-parser": "2.4.1",
|
|
81
|
-
"knip": "5.
|
|
81
|
+
"knip": "5.67.0",
|
|
82
82
|
"lint-staged": "16.2.0",
|
|
83
83
|
"markdownlint": "0.39.0",
|
|
84
84
|
"markdownlint-cli": "0.45.0",
|