eslint-plugin-package-json 0.87.0 β 0.88.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 +28 -4
- package/README.md +12 -6
- package/lib/rules/repository-shorthand.mjs +37 -10
- package/lib/rules/require-properties.mjs +5 -0
- package/lib/utils/createSimpleRequirePropertyRule.d.mts +1 -1
- package/package.json +112 -117
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.88.0](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.87.1...v0.88.0) (2026-01-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### β BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* add require-repository rule ([#1491](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1491))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add require-repository rule ([#1491](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1491)) ([4d802c5](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/4d802c577713a8056c02543faa902b49b3a4950a))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **repository-shorthand:** support repo provider prefix ([#1472](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1472)) ([fb5f10a](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/fb5f10a55078eb9aaeefca690275f67ab136592e))
|
|
18
|
+
* **valid-repository:** support dashes and dots in repo shorthand ([#1468](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1468)) ([8b83678](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/8b83678666f3a0303ac40fadd916faf1ba94020b))
|
|
19
|
+
|
|
20
|
+
## [0.87.1](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.87.0...v0.87.1) (2025-12-31)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* add require-homepage rule ([#1480](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1480)) ([0d895ff](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/0d895ff8b5c800df07bdf2ed2bc99e1ad16649ad))
|
|
26
|
+
|
|
3
27
|
## [0.87.0](///compare/v0.86.0...v0.87.0) (2025-12-30)
|
|
4
28
|
|
|
5
29
|
### Features
|
|
6
30
|
|
|
7
|
-
|
|
31
|
+
- move `order-properties` from `recommended` to `stylistic` config ([#1475](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1475)) ([b9a9978](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/b9a9978ed22b2c8184d10dc63da4435fb0864f29)), closes [#1471](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1471)
|
|
8
32
|
|
|
9
33
|
## [0.86.0](///compare/v0.85.0...v0.86.0) (2025-12-30)
|
|
10
34
|
|
|
11
35
|
### Features
|
|
12
36
|
|
|
13
|
-
- remove deprecated valid-local-dependency rule ([#1450](
|
|
14
|
-
- **valid-module:** add rule to validate `module` ([#1462](
|
|
37
|
+
- remove deprecated valid-local-dependency rule ([#1450](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1450)) ([3e36e30](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/3e36e30efef51ed010480e43373e9ac20c9b2014)), closes [#1168](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1168)
|
|
38
|
+
- **valid-module:** add rule to validate `module` ([#1462](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1462)) ([ee376e0](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/ee376e05fad0ba3f137047124a1975893ecc4ca6)), closes [#1034](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1034)
|
|
15
39
|
|
|
16
40
|
## [0.85.0](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.84.0...v0.85.0) (2025-11-18)
|
|
17
41
|
|
|
18
42
|
### Features
|
|
19
43
|
|
|
20
|
-
- **valid-sideEffects:** add new rule for validating `sideEffects` ([#1414](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1414)) ([04b86b1](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/04b86b1a5e86cae4187ca1629ba916066d49b086))
|
|
44
|
+
- **valid-sideEffects:** add new rule for validating `sideEffects` ([#1414](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/1414)) ([04b86b1](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commit/04b86b1a5e86cae4187ca1629ba916066d49b086))
|
|
21
45
|
|
|
22
46
|
## [0.84.0](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.83.0...v0.84.0) (2025-11-18)
|
|
23
47
|
|
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: 37" src="https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-37-21bb42.svg" /></a>
|
|
12
12
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
13
13
|
<!-- prettier-ignore-end -->
|
|
14
14
|
<a href="https://github.com/JoshuaKGoldberg/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>
|
|
@@ -221,11 +221,13 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
|
|
|
221
221
|
| [require-engines](docs/rules/require-engines.md) | Requires the `engines` property to be present. | | | | |
|
|
222
222
|
| [require-exports](docs/rules/require-exports.md) | Requires the `exports` property to be present. | π¦ | | | |
|
|
223
223
|
| [require-files](docs/rules/require-files.md) | Requires the `files` property to be present. | π¦ | | | |
|
|
224
|
+
| [require-homepage](docs/rules/require-homepage.md) | Requires the `homepage` property to be present. | | | | |
|
|
224
225
|
| [require-keywords](docs/rules/require-keywords.md) | Requires the `keywords` property to be present. | | | | |
|
|
225
226
|
| [require-license](docs/rules/require-license.md) | Requires the `license` property to be present. | βοΈ β
π¦ | | | |
|
|
226
227
|
| [require-name](docs/rules/require-name.md) | Requires the `name` property to be present. | βοΈ β
π¦ | | | |
|
|
227
228
|
| [require-optionalDependencies](docs/rules/require-optionalDependencies.md) | Requires the `optionalDependencies` property to be present. | | | | |
|
|
228
229
|
| [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. | π¦ | | | |
|
|
229
231
|
| [require-sideEffects](docs/rules/require-sideEffects.md) | Requires the `sideEffects` property to be present. | π¦ | | | |
|
|
230
232
|
| [require-type](docs/rules/require-type.md) | Requires the `type` property to be present. | βοΈ β
π¦ | | | |
|
|
231
233
|
| [require-types](docs/rules/require-types.md) | Requires the `types` property to be present. | | | | |
|
|
@@ -322,34 +324,38 @@ Thanks! π
|
|
|
322
324
|
<td align="center" valign="top" width="14.28%"><a href="http://www.curtisjewell.dev/"><img src="https://avatars.githubusercontent.com/u/67483?v=4?s=100" width="100px;" alt="Curtis Jewell"/><br /><sub><b>Curtis Jewell</b></sub></a><br /><a href="#ideas-csjewell" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
323
325
|
<td align="center" valign="top" width="14.28%"><a href="https://davidlj95.com"><img src="https://avatars.githubusercontent.com/u/8050648?v=4?s=100" width="100px;" alt="David LJ"/><br /><sub><b>David LJ</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=davidlj95" title="Documentation">π</a></td>
|
|
324
326
|
<td align="center" valign="top" width="14.28%"><a href="http://lishaduck.github.io"><img src="https://avatars.githubusercontent.com/u/88557639?v=4?s=100" width="100px;" alt="Eli"/><br /><sub><b>Eli</b></sub></a><br /><a href="#ideas-lishaduck" title="Ideas, Planning, & Feedback">π€</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Alishaduck" title="Bug reports">π</a></td>
|
|
327
|
+
<td align="center" valign="top" width="14.28%"><a href="https://open-fixture-library.org"><img src="https://avatars.githubusercontent.com/u/202916?v=4?s=100" width="100px;" alt="Flo Edelmann"/><br /><sub><b>Flo Edelmann</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=FloEdelmann" title="Documentation">π</a></td>
|
|
325
328
|
<td align="center" valign="top" width="14.28%"><a href="http://heggria.site"><img src="https://avatars.githubusercontent.com/u/34475327?v=4?s=100" width="100px;" alt="Heggria"/><br /><sub><b>Heggria</b></sub></a><br /><a href="#ideas-heggria" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
326
329
|
<td align="center" valign="top" width="14.28%"><a href="https://hirok.io"><img src="https://avatars.githubusercontent.com/u/1075694?v=4?s=100" width="100px;" alt="Hiroki Osame"/><br /><sub><b>Hiroki Osame</b></sub></a><br /><a href="#ideas-privatenumber" title="Ideas, Planning, & Feedback">π€</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=privatenumber" title="Code">π»</a></td>
|
|
327
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Zamiell"><img src="https://avatars.githubusercontent.com/u/5511220?v=4?s=100" width="100px;" alt="James"/><br /><sub><b>James</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=Zamiell" title="Code">π»</a> <a href="#ideas-Zamiell" title="Ideas, Planning, & Feedback">π€</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3AZamiell" title="Bug reports">π</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=Zamiell" title="Documentation">π</a></td>
|
|
328
330
|
</tr>
|
|
329
331
|
<tr>
|
|
332
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Zamiell"><img src="https://avatars.githubusercontent.com/u/5511220?v=4?s=100" width="100px;" alt="James"/><br /><sub><b>James</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=Zamiell" title="Code">π»</a> <a href="#ideas-Zamiell" title="Ideas, Planning, & Feedback">π€</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3AZamiell" title="Bug reports">π</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=Zamiell" title="Documentation">π</a></td>
|
|
330
333
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zetlen"><img src="https://avatars.githubusercontent.com/u/1643758?v=4?s=100" width="100px;" alt="James Zetlen"/><br /><sub><b>James Zetlen</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=zetlen" title="Code">π»</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Azetlen" title="Bug reports">π</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=zetlen" title="Documentation">π</a> <a href="#infra-zetlen" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="#maintenance-zetlen" title="Maintenance">π§</a> <a href="#tool-zetlen" title="Tools">π§</a></td>
|
|
331
334
|
<td align="center" valign="top" width="14.28%"><a href="https://piranna.github.io/"><img src="https://avatars.githubusercontent.com/u/532414?v=4?s=100" width="100px;" alt="JesΓΊs LeganΓ©s-Combarro"/><br /><sub><b>JesΓΊs LeganΓ©s-Combarro</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=piranna" title="Code">π»</a></td>
|
|
332
335
|
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com/"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg β¨"/><br /><sub><b>Josh Goldberg β¨</b></sub></a><br /><a href="#tool-JoshuaKGoldberg" title="Tools">π§</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3AJoshuaKGoldberg" title="Bug reports">π</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=JoshuaKGoldberg" title="Code">π»</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=JoshuaKGoldberg" title="Documentation">π</a> <a href="#maintenance-JoshuaKGoldberg" title="Maintenance">π§</a> <a href="#ideas-JoshuaKGoldberg" title="Ideas, Planning, & Feedback">π€</a> <a href="#content-JoshuaKGoldberg" title="Content">π</a> <a href="#projectManagement-JoshuaKGoldberg" title="Project Management">π</a></td>
|
|
333
336
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kendallgassner"><img src="https://avatars.githubusercontent.com/u/15275462?v=4?s=100" width="100px;" alt="Kendall Gassner"/><br /><sub><b>Kendall Gassner</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=kendallgassner" title="Code">π»</a> <a href="#maintenance-kendallgassner" title="Maintenance">π§</a></td>
|
|
334
337
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/KristjanESPERANTO"><img src="https://avatars.githubusercontent.com/u/35647502?v=4?s=100" width="100px;" alt="Kristjan ESPERANTO"/><br /><sub><b>Kristjan ESPERANTO</b></sub></a><br /><a href="#ideas-kristjanesperanto" title="Ideas, Planning, & Feedback">π€</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Akristjanesperanto" title="Bug reports">π</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=kristjanesperanto" title="Code">π»</a></td>
|
|
335
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/
|
|
336
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Cellule"><img src="https://avatars.githubusercontent.com/u/4157103?v=4?s=100" width="100px;" alt="Michael "Mike" Ferris"/><br /><sub><b>Michael "Mike" Ferris</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=cellule" title="Code">π»</a></td>
|
|
338
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/marcalexiei"><img src="https://avatars.githubusercontent.com/u/24919330?v=4?s=100" width="100px;" alt="Marco Pasqualetti"/><br /><sub><b>Marco Pasqualetti</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=marcalexiei" title="Code">π»</a> <a href="#tool-marcalexiei" title="Tools">π§</a> <a href="#maintenance-marcalexiei" title="Maintenance">π§</a></td>
|
|
337
339
|
</tr>
|
|
338
340
|
<tr>
|
|
341
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lo1tuma"><img src="https://avatars.githubusercontent.com/u/169170?v=4?s=100" width="100px;" alt="Mathias Schreck"/><br /><sub><b>Mathias Schreck</b></sub></a><br /><a href="#ideas-lo1tuma" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
342
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Cellule"><img src="https://avatars.githubusercontent.com/u/4157103?v=4?s=100" width="100px;" alt="Michael "Mike" Ferris"/><br /><sub><b>Michael "Mike" Ferris</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=cellule" title="Code">π»</a></td>
|
|
339
343
|
<td align="center" valign="top" width="14.28%"><a href="https://morrisoncole.co.uk"><img src="https://avatars.githubusercontent.com/u/963368?v=4?s=100" width="100px;" alt="Morrison Cole"/><br /><sub><b>Morrison Cole</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3AMorrisonCole" title="Bug reports">π</a></td>
|
|
340
344
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nschonni"><img src="https://avatars.githubusercontent.com/u/1297909?v=4?s=100" width="100px;" alt="Nick Schonning"/><br /><sub><b>Nick Schonning</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=nschonni" title="Code">π»</a></td>
|
|
341
345
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/OlivierZal"><img src="https://avatars.githubusercontent.com/u/88216225?v=4?s=100" width="100px;" alt="Olivier Zalmanski"/><br /><sub><b>Olivier Zalmanski</b></sub></a><br /><a href="#maintenance-olivierzal" title="Maintenance">π§</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=olivierzal" title="Documentation">π</a></td>
|
|
342
346
|
<td align="center" valign="top" width="14.28%"><a href="http://patrikcsak.com"><img src="https://avatars.githubusercontent.com/u/4766244?v=4?s=100" width="100px;" alt="Patrik Csak"/><br /><sub><b>Patrik Csak</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Apatrik-csak" title="Bug reports">π</a></td>
|
|
343
347
|
<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/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=rakleed" title="Documentation">π</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=rakleed" title="Code">π»</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Arakleed" title="Bug reports">π</a></td>
|
|
344
|
-
<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/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=sasial-dev" title="Code">π»</a></td>
|
|
345
|
-
<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/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=sirugh" title="Code">π»</a></td>
|
|
346
348
|
</tr>
|
|
347
349
|
<tr>
|
|
350
|
+
<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/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=sasial-dev" title="Code">π»</a></td>
|
|
351
|
+
<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/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=sirugh" title="Code">π»</a></td>
|
|
348
352
|
<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/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Ahyoban" title="Bug reports">π</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=hyoban" title="Code">π»</a> <a href="#ideas-hyoban" title="Ideas, Planning, & Feedback">π€</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=hyoban" title="Documentation">π</a></td>
|
|
349
353
|
<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/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Aota-meshi" title="Bug reports">π</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=ota-meshi" title="Code">π»</a></td>
|
|
350
354
|
<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/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Ab3rnhard" title="Bug reports">π</a></td>
|
|
351
355
|
<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/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=chouchouji" title="Code">π»</a></td>
|
|
352
356
|
<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/JoshuaKGoldberg/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/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Amichaelfaith" title="Bug reports">π</a> <a href="#tool-michaelfaith" title="Tools">π§</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=michaelfaith" title="Documentation">π</a></td>
|
|
357
|
+
</tr>
|
|
358
|
+
<tr>
|
|
353
359
|
<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/JoshuaKGoldberg/eslint-plugin-package-json/commits?author=roottool" title="Code">π»</a></td>
|
|
354
360
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sunnytsang1998"><img src="https://avatars.githubusercontent.com/u/207208443?v=4?s=100" width="100px;" alt="sunnytsang1998"/><br /><sub><b>sunnytsang1998</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues?q=author%3Asunnytsang1998" title="Bug reports">π</a></td>
|
|
355
361
|
</tr>
|
|
@@ -3,9 +3,34 @@ import { isJSONStringLiteral } from "../utils/predicates.mjs";
|
|
|
3
3
|
import { findPropertyWithKeyValue } from "../utils/findPropertyWithKeyValue.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/rules/repository-shorthand.ts
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const providerRegexes = {
|
|
7
|
+
bitbucket: /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?bitbucket\.org\//,
|
|
8
|
+
gist: /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?gist\.github\.com\//,
|
|
9
|
+
github: /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?github\.com\//,
|
|
10
|
+
gitlab: /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?gitlab\.com\//
|
|
11
|
+
};
|
|
12
|
+
const providerUrls = {
|
|
13
|
+
bitbucket: "https://bitbucket.org/",
|
|
14
|
+
gist: "https://gist.github.com/",
|
|
15
|
+
github: "https://github.com/",
|
|
16
|
+
gitlab: "https://gitlab.com/"
|
|
17
|
+
};
|
|
18
|
+
const providers = Object.keys(providerRegexes);
|
|
19
|
+
const isProvider = (value) => value in providerRegexes;
|
|
20
|
+
const cleanUrl = (url, provider) => url.replace(providerRegexes[provider], "").replace(/\.git$/, "");
|
|
21
|
+
const getProviderFromUrl = (url) => {
|
|
22
|
+
return providers.find((provider) => providerRegexes[provider].test(url));
|
|
23
|
+
};
|
|
24
|
+
const createShorthand = (url, provider) => {
|
|
25
|
+
return `${provider}:${cleanUrl(url, provider)}`;
|
|
26
|
+
};
|
|
27
|
+
const createUrl = (shorthand) => {
|
|
28
|
+
if (shorthand.includes(":")) {
|
|
29
|
+
const [provider, repo] = shorthand.split(":");
|
|
30
|
+
if (isProvider(provider)) return `${providerUrls[provider]}${repo}`;
|
|
31
|
+
}
|
|
32
|
+
return `${providerUrls.github}${shorthand}`;
|
|
33
|
+
};
|
|
9
34
|
const rule = createRule({
|
|
10
35
|
create(context) {
|
|
11
36
|
const [{ form = "object" } = {}] = context.options;
|
|
@@ -15,7 +40,7 @@ const rule = createRule({
|
|
|
15
40
|
if (!isJSONStringLiteral(node.value) || node.value.value.split("/").filter(Boolean).length !== 2) return null;
|
|
16
41
|
return fixer.replaceText(node.value, JSON.stringify({
|
|
17
42
|
type: "git",
|
|
18
|
-
url:
|
|
43
|
+
url: createUrl(node.value.value)
|
|
19
44
|
}, null, 2));
|
|
20
45
|
},
|
|
21
46
|
messageId: "preferObject",
|
|
@@ -25,9 +50,10 @@ const rule = createRule({
|
|
|
25
50
|
function validateRepositoryForShorthand(node) {
|
|
26
51
|
if (isJSONStringLiteral(node.value)) {
|
|
27
52
|
const { value } = node.value;
|
|
28
|
-
|
|
53
|
+
const provider$1 = getProviderFromUrl(value);
|
|
54
|
+
if (provider$1) context.report({
|
|
29
55
|
fix(fixer) {
|
|
30
|
-
return fixer.replaceText(node.value, JSON.stringify(
|
|
56
|
+
return fixer.replaceText(node.value, JSON.stringify(createShorthand(value, provider$1)));
|
|
31
57
|
},
|
|
32
58
|
messageId: "preferShorthand",
|
|
33
59
|
node: node.value
|
|
@@ -40,11 +66,12 @@ const rule = createRule({
|
|
|
40
66
|
const typeProperty = findPropertyWithKeyValue(properties, "type");
|
|
41
67
|
if (typeProperty?.value.type !== "JSONLiteral" || typeProperty.value.value !== "git") return;
|
|
42
68
|
const urlProperty = findPropertyWithKeyValue(properties, "url");
|
|
43
|
-
if (urlProperty?.value.type !== "JSONLiteral" || typeof urlProperty.value.value !== "string"
|
|
69
|
+
if (urlProperty?.value.type !== "JSONLiteral" || typeof urlProperty.value.value !== "string") return;
|
|
44
70
|
const url = urlProperty.value.value;
|
|
45
|
-
|
|
71
|
+
const provider = getProviderFromUrl(url);
|
|
72
|
+
if (provider) context.report({
|
|
46
73
|
fix(fixer) {
|
|
47
|
-
return fixer.replaceText(node.value, JSON.stringify(
|
|
74
|
+
return fixer.replaceText(node.value, JSON.stringify(createShorthand(url, provider)));
|
|
48
75
|
},
|
|
49
76
|
messageId: "preferShorthand",
|
|
50
77
|
node: node.value
|
|
@@ -66,7 +93,7 @@ const rule = createRule({
|
|
|
66
93
|
fixable: "code",
|
|
67
94
|
messages: {
|
|
68
95
|
preferObject: "Prefer an object locator for a repository.",
|
|
69
|
-
preferShorthand: "Prefer a shorthand locator for a
|
|
96
|
+
preferShorthand: "Prefer a shorthand locator for a supported repository provider."
|
|
70
97
|
},
|
|
71
98
|
schema: [{
|
|
72
99
|
additionalProperties: false,
|
|
@@ -11,6 +11,7 @@ const properties = [
|
|
|
11
11
|
["engines"],
|
|
12
12
|
["exports", { category: "Publishable" }],
|
|
13
13
|
["files", { category: "Publishable" }],
|
|
14
|
+
["homepage"],
|
|
14
15
|
["keywords"],
|
|
15
16
|
["license", {
|
|
16
17
|
ignorePrivateDefault: true,
|
|
@@ -22,6 +23,10 @@ const properties = [
|
|
|
22
23
|
}],
|
|
23
24
|
["optionalDependencies"],
|
|
24
25
|
["peerDependencies"],
|
|
26
|
+
["repository", {
|
|
27
|
+
category: "Publishable",
|
|
28
|
+
ignorePrivateDefault: true
|
|
29
|
+
}],
|
|
25
30
|
["sideEffects", { category: "Publishable" }],
|
|
26
31
|
["type", { isRecommended: true }],
|
|
27
32
|
["types"],
|
package/package.json
CHANGED
|
@@ -1,118 +1,113 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"packageManager": "pnpm@10.26.0",
|
|
115
|
-
"engines": {
|
|
116
|
-
"node": "^20.19.0 || >=22.12.0"
|
|
117
|
-
}
|
|
118
|
-
}
|
|
2
|
+
"name": "eslint-plugin-package-json",
|
|
3
|
+
"version": "0.88.0",
|
|
4
|
+
"description": "Rules for consistent, readable, and valid package.json files. ποΈ",
|
|
5
|
+
"homepage": "https://github.com/JoshuaKGoldberg/eslint-plugin-package-json#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/JoshuaKGoldberg/eslint-plugin-package-json.git"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"contributors": [
|
|
15
|
+
{
|
|
16
|
+
"name": "James Zetlen",
|
|
17
|
+
"email": "zetlen@gmail.com"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "JoshuaKGoldberg",
|
|
21
|
+
"email": "npm@joshuakgoldberg.com",
|
|
22
|
+
"url": "https://joshuakgoldberg.com"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "michael faith",
|
|
26
|
+
"email": "michaelfaith@users.noreply.github.com",
|
|
27
|
+
"url": "https://michael.faith"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"type": "module",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./lib/index.d.mts",
|
|
35
|
+
"default": "./lib/index.mjs"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"main": "lib/index.mjs",
|
|
39
|
+
"files": [
|
|
40
|
+
"CHANGELOG.md",
|
|
41
|
+
"lib/"
|
|
42
|
+
],
|
|
43
|
+
"lint-staged": {
|
|
44
|
+
"*": "prettier --ignore-unknown --write"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@altano/repository-tools": "^2.0.1",
|
|
48
|
+
"change-case": "^5.4.4",
|
|
49
|
+
"detect-indent": "^7.0.2",
|
|
50
|
+
"detect-newline": "^4.0.1",
|
|
51
|
+
"eslint-fix-utils": "~0.4.0",
|
|
52
|
+
"package-json-validator": "~0.59.1",
|
|
53
|
+
"semver": "^7.7.3",
|
|
54
|
+
"sort-object-keys": "^2.0.0",
|
|
55
|
+
"sort-package-json": "^3.4.0",
|
|
56
|
+
"validate-npm-package-name": "^7.0.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
60
|
+
"@eslint/js": "9.39.1",
|
|
61
|
+
"@eslint/markdown": "7.5.1",
|
|
62
|
+
"@types/estree": "1.0.8",
|
|
63
|
+
"@types/node": "24.10.1",
|
|
64
|
+
"@types/semver": "7.7.1",
|
|
65
|
+
"@types/validate-npm-package-name": "4.0.2",
|
|
66
|
+
"@vitest/coverage-v8": "4.0.13",
|
|
67
|
+
"@vitest/eslint-plugin": "1.6.1",
|
|
68
|
+
"console-fail-test": "0.6.0",
|
|
69
|
+
"eslint": "9.39.1",
|
|
70
|
+
"eslint-doc-generator": "2.4.0",
|
|
71
|
+
"eslint-plugin-eslint-plugin": "7.2.0",
|
|
72
|
+
"eslint-plugin-jsdoc": "61.5.0",
|
|
73
|
+
"eslint-plugin-jsonc": "2.21.0",
|
|
74
|
+
"eslint-plugin-markdown-links": "0.7.1",
|
|
75
|
+
"eslint-plugin-n": "17.23.1",
|
|
76
|
+
"eslint-plugin-node-dependencies": "1.3.0",
|
|
77
|
+
"eslint-plugin-perfectionist": "5.2.0",
|
|
78
|
+
"eslint-plugin-regexp": "2.10.0",
|
|
79
|
+
"eslint-plugin-unicorn": "62.0.0",
|
|
80
|
+
"eslint-plugin-yml": "1.19.0",
|
|
81
|
+
"husky": "9.1.7",
|
|
82
|
+
"jiti": "2.6.1",
|
|
83
|
+
"json-schema-to-ts": "3.1.1",
|
|
84
|
+
"jsonc-eslint-parser": "2.4.1",
|
|
85
|
+
"knip": "5.78.0",
|
|
86
|
+
"lint-staged": "16.2.7",
|
|
87
|
+
"prettier": "3.7.0",
|
|
88
|
+
"prettier-plugin-curly": "0.4.0",
|
|
89
|
+
"prettier-plugin-packagejson": "2.5.19",
|
|
90
|
+
"prettier-plugin-sh": "0.18.0",
|
|
91
|
+
"tsdown": "0.18.0",
|
|
92
|
+
"typescript": "5.9.3",
|
|
93
|
+
"typescript-eslint": "8.51.0",
|
|
94
|
+
"vitest": "4.0.13"
|
|
95
|
+
},
|
|
96
|
+
"peerDependencies": {
|
|
97
|
+
"eslint": ">=8.0.0",
|
|
98
|
+
"jsonc-eslint-parser": "^2.0.0"
|
|
99
|
+
},
|
|
100
|
+
"engines": {
|
|
101
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
102
|
+
},
|
|
103
|
+
"scripts": {
|
|
104
|
+
"build": "tsdown",
|
|
105
|
+
"build:docs": "pnpm build --no-dts && eslint-doc-generator",
|
|
106
|
+
"format": "prettier .",
|
|
107
|
+
"lint": "eslint . --max-warnings 0",
|
|
108
|
+
"lint:docs": "eslint-doc-generator --check",
|
|
109
|
+
"lint:knip": "knip",
|
|
110
|
+
"test": "vitest",
|
|
111
|
+
"typecheck": "tsc"
|
|
112
|
+
}
|
|
113
|
+
}
|