eslint-plugin-package-json 0.90.0 → 0.91.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,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.91.0](https://github.com/michaelfaith/eslint-plugin-package-json/compare/v0.90.1...v0.91.0) (2026-03-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* add `valid-devEngines` rule ([#1663](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1663))
|
|
9
|
+
|
|
10
|
+
### 🚀 Features
|
|
11
|
+
|
|
12
|
+
* add `require-cpu` rule ([#1659](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1659)) ([40ed2f6](https://github.com/michaelfaith/eslint-plugin-package-json/commit/40ed2f6a97040bcf5d516bcf1ac3e1a3a580c5ee))
|
|
13
|
+
* add `valid-devEngines` rule ([#1663](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1663)) ([7325be2](https://github.com/michaelfaith/eslint-plugin-package-json/commit/7325be2c6d3bc77467e8da7019ac24861261e27a))
|
|
14
|
+
* add require-module rule ([#1656](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1656)) ([557254c](https://github.com/michaelfaith/eslint-plugin-package-json/commit/557254cac267d1f37fe019662f8293d123aa0e60))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### 🩹 Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **valid-publishConfig:** rule not reporting violations for deeply nested objects ([#1662](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1662)) ([4c78698](https://github.com/michaelfaith/eslint-plugin-package-json/commit/4c786980b3efc2c25bc9a767a826ec43c3912c2e))
|
|
20
|
+
|
|
21
|
+
## [0.90.1](https://github.com/michaelfaith/eslint-plugin-package-json/compare/v0.90.0...v0.90.1) (2026-03-10)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### 🚀 Features
|
|
25
|
+
|
|
26
|
+
* add `require-bin` rule ([#1652](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1652)) ([434e605](https://github.com/michaelfaith/eslint-plugin-package-json/commit/434e60523a067128e92baa8debf0362ef06c89c6))
|
|
27
|
+
* add `require-contributors` rule ([#1648](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1648)) ([4a666ea](https://github.com/michaelfaith/eslint-plugin-package-json/commit/4a666ea9487c4afcc9a0ca0e730d51368266c06a))
|
|
28
|
+
* add `require-devEngines` rule ([#1649](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1649)) ([608744c](https://github.com/michaelfaith/eslint-plugin-package-json/commit/608744c3cb29f2dd9808a91cfb99def404a9bdf2))
|
|
29
|
+
* add `require-directories` rule ([#1654](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1654)) ([91369d6](https://github.com/michaelfaith/eslint-plugin-package-json/commit/91369d614c72707eeb9f42d73e971645e3ab590f))
|
|
30
|
+
* add `require-funding` rule ([#1647](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1647)) ([d2405a1](https://github.com/michaelfaith/eslint-plugin-package-json/commit/d2405a1e6e05ef27bcca850ff5cc034c78c51780))
|
|
31
|
+
* add `require-man` rule ([#1653](https://github.com/michaelfaith/eslint-plugin-package-json/issues/1653)) ([e1cdd8a](https://github.com/michaelfaith/eslint-plugin-package-json/commit/e1cdd8ae35e768772fba92e0188798ac4870099d))
|
|
32
|
+
|
|
3
33
|
## [0.90.0](https://github.com/michaelfaith/eslint-plugin-package-json/compare/v0.89.4...v0.90.0) (2026-03-10)
|
|
4
34
|
|
|
5
35
|
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<!-- prettier-ignore-start -->
|
|
10
10
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
11
|
-
<a href="#contributors" target="_blank"><img alt="👪 All Contributors:
|
|
11
|
+
<a href="#contributors" target="_blank"><img alt="👪 All Contributors: 40" src="https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-40-21bb42.svg" /></a>
|
|
12
12
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
13
13
|
<!-- prettier-ignore-end -->
|
|
14
14
|
<a href="https://github.com/michaelfaith/eslint-plugin-package-json/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="🤝 Code of Conduct: Kept" src="https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42" /></a>
|
|
@@ -217,18 +217,26 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
|
|
|
217
217
|
| [repository-shorthand](docs/rules/repository-shorthand.md) | Enforce either object or shorthand declaration for repository. | ✔️ ✅ 📦 | 🔧 | | |
|
|
218
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. | ✔️ ✅ 📦 | | 💡 | |
|
|
219
219
|
| [require-author](docs/rules/require-author.md) | Requires the `author` property to be present. | | | | |
|
|
220
|
+
| [require-bin](docs/rules/require-bin.md) | Requires the `bin` property to be present. | | | | |
|
|
220
221
|
| [require-bugs](docs/rules/require-bugs.md) | Requires the `bugs` property to be present. | | | | |
|
|
221
222
|
| [require-bundleDependencies](docs/rules/require-bundleDependencies.md) | Requires the `bundleDependencies` property to be present. | | | | |
|
|
223
|
+
| [require-contributors](docs/rules/require-contributors.md) | Requires the `contributors` property to be present. | | | | |
|
|
224
|
+
| [require-cpu](docs/rules/require-cpu.md) | Requires the `cpu` property to be present. | | | | |
|
|
222
225
|
| [require-dependencies](docs/rules/require-dependencies.md) | Requires the `dependencies` property to be present. | | | | |
|
|
223
226
|
| [require-description](docs/rules/require-description.md) | Requires the `description` property to be present. | ✔️ ✅ 📦 | | | |
|
|
224
227
|
| [require-devDependencies](docs/rules/require-devDependencies.md) | Requires the `devDependencies` property to be present. | | | | |
|
|
228
|
+
| [require-devEngines](docs/rules/require-devEngines.md) | Requires the `devEngines` property to be present. | | | | |
|
|
229
|
+
| [require-directories](docs/rules/require-directories.md) | Requires the `directories` property to be present. | | | | |
|
|
225
230
|
| [require-engines](docs/rules/require-engines.md) | Requires the `engines` property to be present. | | | | |
|
|
226
231
|
| [require-exports](docs/rules/require-exports.md) | Requires the `exports` property to be present. | ✔️ ✅ 📦 | | | |
|
|
227
232
|
| [require-files](docs/rules/require-files.md) | Requires the `files` property to be present. | ✔️ ✅ 📦 | | | |
|
|
233
|
+
| [require-funding](docs/rules/require-funding.md) | Requires the `funding` property to be present. | | | | |
|
|
228
234
|
| [require-homepage](docs/rules/require-homepage.md) | Requires the `homepage` property to be present. | | | | |
|
|
229
235
|
| [require-keywords](docs/rules/require-keywords.md) | Requires the `keywords` property to be present. | | | | |
|
|
230
236
|
| [require-license](docs/rules/require-license.md) | Requires the `license` property to be present. | ✔️ ✅ 📦 | | | |
|
|
231
237
|
| [require-main](docs/rules/require-main.md) | Requires the `main` property to be present. | | | | |
|
|
238
|
+
| [require-man](docs/rules/require-man.md) | Requires the `man` property to be present. | | | | |
|
|
239
|
+
| [require-module](docs/rules/require-module.md) | Requires the `module` property to be present. | | | | |
|
|
232
240
|
| [require-name](docs/rules/require-name.md) | Requires the `name` property to be present. | ✔️ ✅ 📦 | | | |
|
|
233
241
|
| [require-optionalDependencies](docs/rules/require-optionalDependencies.md) | Requires the `optionalDependencies` property to be present. | | | | |
|
|
234
242
|
| [require-os](docs/rules/require-os.md) | Requires the `os` property to be present. | | | | |
|
|
@@ -258,6 +266,7 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
|
|
|
258
266
|
| [valid-dependencies](docs/rules/valid-dependencies.md) | Enforce that the `dependencies` property is valid. | ✔️ ✅ 📦 | | | |
|
|
259
267
|
| [valid-description](docs/rules/valid-description.md) | Enforce that the `description` property is valid. | ✔️ ✅ 📦 | | | |
|
|
260
268
|
| [valid-devDependencies](docs/rules/valid-devDependencies.md) | Enforce that the `devDependencies` property is valid. | ✔️ ✅ 📦 | | | |
|
|
269
|
+
| [valid-devEngines](docs/rules/valid-devEngines.md) | Enforce that the `devEngines` property is valid. | ✔️ ✅ 📦 | | | |
|
|
261
270
|
| [valid-directories](docs/rules/valid-directories.md) | Enforce that the `directories` property is valid. | ✔️ ✅ 📦 | | | |
|
|
262
271
|
| [valid-engines](docs/rules/valid-engines.md) | Enforce that the `engines` property is valid. | ✔️ ✅ 📦 | | | |
|
|
263
272
|
| [valid-exports](docs/rules/valid-exports.md) | Enforce that the `exports` property is valid. | ✔️ ✅ 📦 | | | |
|
|
@@ -363,12 +372,13 @@ Thanks! 🗂
|
|
|
363
372
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rakleed"><img src="https://avatars.githubusercontent.com/u/19418601?v=4?s=100" width="100px;" alt="Pavel"/><br /><sub><b>Pavel</b></sub></a><br /><a href="#ideas-rakleed" title="Ideas, Planning, & Feedback">🤔</a> <a href="#tool-rakleed" title="Tools">🔧</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=rakleed" title="Documentation">📖</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=rakleed" title="Code">💻</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/issues?q=author%3Arakleed" title="Bug reports">🐛</a></td>
|
|
364
373
|
<td align="center" valign="top" width="14.28%"><a href="https://sasial.dev"><img src="https://avatars.githubusercontent.com/u/44125644?v=4?s=100" width="100px;" alt="Sasial"/><br /><sub><b>Sasial</b></sub></a><br /><a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=sasial-dev" title="Code">💻</a></td>
|
|
365
374
|
<td align="center" valign="top" width="14.28%"><a href="https://shayan-zamani.me"><img src="https://avatars.githubusercontent.com/u/81762186?v=4?s=100" width="100px;" alt="Shayan Zamani"/><br /><sub><b>Shayan Zamani</b></sub></a><br /><a href="#ideas-ShayanTheNerd" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=ShayanTheNerd" title="Documentation">📖</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=ShayanTheNerd" title="Code">💻</a></td>
|
|
375
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Sigmabrogz"><img src="https://avatars.githubusercontent.com/u/122412346?v=4?s=100" width="100px;" alt="Sigmabro"/><br /><sub><b>Sigmabro</b></sub></a><br /><a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=Sigmabrogz" title="Code">💻</a></td>
|
|
366
376
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sirugh"><img src="https://avatars.githubusercontent.com/u/1278869?v=4?s=100" width="100px;" alt="Stephen"/><br /><sub><b>Stephen</b></sub></a><br /><a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=sirugh" title="Code">💻</a></td>
|
|
367
377
|
<td align="center" valign="top" width="14.28%"><a href="https://hyoban.cc"><img src="https://avatars.githubusercontent.com/u/38493346?v=4?s=100" width="100px;" alt="Stephen Zhou"/><br /><sub><b>Stephen Zhou</b></sub></a><br /><a href="https://github.com/michaelfaith/eslint-plugin-package-json/issues?q=author%3Ahyoban" title="Bug reports">🐛</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=hyoban" title="Code">💻</a> <a href="#ideas-hyoban" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=hyoban" title="Documentation">📖</a></td>
|
|
368
378
|
<td align="center" valign="top" width="14.28%"><a href="https://ota-meshi.github.io/"><img src="https://avatars.githubusercontent.com/u/16508807?v=4?s=100" width="100px;" alt="Yosuke Ota"/><br /><sub><b>Yosuke Ota</b></sub></a><br /><a href="https://github.com/michaelfaith/eslint-plugin-package-json/issues?q=author%3Aota-meshi" title="Bug reports">🐛</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=ota-meshi" title="Code">💻</a></td>
|
|
369
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/b3rnhard"><img src="https://avatars.githubusercontent.com/u/10774404?v=4?s=100" width="100px;" alt="b3rnhard"/><br /><sub><b>b3rnhard</b></sub></a><br /><a href="https://github.com/michaelfaith/eslint-plugin-package-json/issues?q=author%3Ab3rnhard" title="Bug reports">🐛</a></td>
|
|
370
379
|
</tr>
|
|
371
380
|
<tr>
|
|
381
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/b3rnhard"><img src="https://avatars.githubusercontent.com/u/10774404?v=4?s=100" width="100px;" alt="b3rnhard"/><br /><sub><b>b3rnhard</b></sub></a><br /><a href="https://github.com/michaelfaith/eslint-plugin-package-json/issues?q=author%3Ab3rnhard" title="Bug reports">🐛</a></td>
|
|
372
382
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/chouchouji"><img src="https://avatars.githubusercontent.com/u/70570907?v=4?s=100" width="100px;" alt="chouchouji"/><br /><sub><b>chouchouji</b></sub></a><br /><a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=chouchouji" title="Code">💻</a></td>
|
|
373
383
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/michaelfaith"><img src="https://avatars.githubusercontent.com/u/8071845?v=4?s=100" width="100px;" alt="michael faith"/><br /><sub><b>michael faith</b></sub></a><br /><a href="#infra-michaelfaith" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=michaelfaith" title="Code">💻</a> <a href="#maintenance-michaelfaith" title="Maintenance">🚧</a> <a href="#ideas-michaelfaith" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/issues?q=author%3Amichaelfaith" title="Bug reports">🐛</a> <a href="#tool-michaelfaith" title="Tools">🔧</a> <a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=michaelfaith" title="Documentation">📖</a> <a href="#projectManagement-michaelfaith" title="Project Management">📆</a></td>
|
|
374
384
|
<td align="center" valign="top" width="14.28%"><a href="https://roottool.vercel.app"><img src="https://avatars.githubusercontent.com/u/11808736?v=4?s=100" width="100px;" alt="roottool"/><br /><sub><b>roottool</b></sub></a><br /><a href="https://github.com/michaelfaith/eslint-plugin-package-json/commits?author=roottool" title="Code">💻</a></td>
|
|
@@ -2,11 +2,16 @@ import { createSimpleRequirePropertyRule } from "../utils/createSimpleRequirePro
|
|
|
2
2
|
//#region src/rules/require-properties.ts
|
|
3
3
|
const propertyConfig = [
|
|
4
4
|
["author"],
|
|
5
|
+
["bin"],
|
|
5
6
|
["bugs", { ignorePrivateDefault: true }],
|
|
6
7
|
["bundleDependencies"],
|
|
8
|
+
["contributors"],
|
|
9
|
+
["cpu"],
|
|
7
10
|
["dependencies"],
|
|
8
11
|
["description", { isRecommended: true }],
|
|
9
12
|
["devDependencies"],
|
|
13
|
+
["devEngines"],
|
|
14
|
+
["directories"],
|
|
10
15
|
["engines"],
|
|
11
16
|
["exports", {
|
|
12
17
|
ignorePrivateDefault: true,
|
|
@@ -16,6 +21,7 @@ const propertyConfig = [
|
|
|
16
21
|
ignorePrivateDefault: true,
|
|
17
22
|
isRecommended: true
|
|
18
23
|
}],
|
|
24
|
+
["funding"],
|
|
19
25
|
["homepage", { ignorePrivateDefault: true }],
|
|
20
26
|
["keywords", { ignorePrivateDefault: true }],
|
|
21
27
|
["license", {
|
|
@@ -23,6 +29,8 @@ const propertyConfig = [
|
|
|
23
29
|
isRecommended: true
|
|
24
30
|
}],
|
|
25
31
|
["main"],
|
|
32
|
+
["man"],
|
|
33
|
+
["module"],
|
|
26
34
|
["name", {
|
|
27
35
|
ignorePrivateDefault: true,
|
|
28
36
|
isRecommended: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createSimpleValidPropertyRule } from "../utils/createSimpleValidPropertyRule.mjs";
|
|
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";
|
|
2
|
+
import { validateAuthor, validateBin, validateBugs, validateBundleDependencies, validateConfig, validateContributors, validateCpu, validateDependencies, validateDescription, validateDevEngines, validateDirectories, validateEngines, validateExports, validateFiles, validateFunding, validateHomepage, validateKeywords, validateLicense, validateMain, validateMan, validateOs, validatePackageManager, validatePrivate, validatePublishConfig, validateRepository, validateScripts, validateSideEffects, validateType, validateWorkspaces } from "package-json-validator";
|
|
3
3
|
//#region src/rules/valid-properties.ts
|
|
4
4
|
const properties = [
|
|
5
5
|
["author", validateAuthor],
|
|
@@ -15,6 +15,7 @@ const properties = [
|
|
|
15
15
|
["description", validateDescription],
|
|
16
16
|
["dependencies", validateDependencies],
|
|
17
17
|
["devDependencies", validateDependencies],
|
|
18
|
+
["devEngines", validateDevEngines],
|
|
18
19
|
["directories", validateDirectories],
|
|
19
20
|
["engines", validateEngines],
|
|
20
21
|
["exports", validateExports],
|
|
@@ -22,7 +22,7 @@ const createSimpleValidPropertyRule = (propertyName, validationFunction, aliases
|
|
|
22
22
|
const childrenWithIssues = result.childResults.filter((childResult) => childResult.errorMessages.length);
|
|
23
23
|
if (node.type === "JSONObjectExpression" && childrenWithIssues.length) for (const childResult of childrenWithIssues) {
|
|
24
24
|
const childNode = node.properties[childResult.index];
|
|
25
|
-
reportIssues(childResult, childNode);
|
|
25
|
+
reportIssues(childResult, childNode.value);
|
|
26
26
|
}
|
|
27
27
|
else if (node.type === "JSONArrayExpression" && childrenWithIssues.length) for (const childResult of childrenWithIssues) {
|
|
28
28
|
const childNode = node.elements[childResult.index];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-package-json",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.91.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,7 +49,7 @@
|
|
|
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.
|
|
52
|
+
"package-json-validator": "^1.3.1",
|
|
53
53
|
"semver": "^7.7.3",
|
|
54
54
|
"sort-object-keys": "^2.0.0",
|
|
55
55
|
"sort-package-json": "^3.4.0",
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
"eslint-plugin-n": "17.24.0",
|
|
75
75
|
"eslint-plugin-node-dependencies": "2.2.0",
|
|
76
76
|
"eslint-plugin-perfectionist": "5.6.0",
|
|
77
|
-
"eslint-plugin-regexp": "3.
|
|
77
|
+
"eslint-plugin-regexp": "3.1.0",
|
|
78
78
|
"eslint-plugin-unicorn": "63.0.0",
|
|
79
79
|
"eslint-plugin-yml": "3.3.0",
|
|
80
80
|
"husky": "9.1.7",
|
|
81
81
|
"jiti": "2.6.1",
|
|
82
82
|
"json-schema-to-ts": "3.1.1",
|
|
83
83
|
"jsonc-eslint-parser": "3.1.0",
|
|
84
|
-
"knip": "5.
|
|
84
|
+
"knip": "5.86.0",
|
|
85
85
|
"lint-staged": "16.3.0",
|
|
86
86
|
"prettier": "3.8.0",
|
|
87
87
|
"prettier-plugin-curly": "0.4.0",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"prettier-plugin-sh": "0.18.0",
|
|
91
91
|
"tsdown": "0.21.0",
|
|
92
92
|
"typescript": "5.9.3",
|
|
93
|
-
"typescript-eslint": "8.
|
|
93
|
+
"typescript-eslint": "8.57.0",
|
|
94
94
|
"vitest": "4.0.13"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|