eslint-plugin-package-json 0.87.1 β†’ 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 CHANGED
@@ -1,5 +1,22 @@
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
+
3
20
  ## [0.87.1](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.87.0...v0.87.1) (2025-12-31)
4
21
 
5
22
 
@@ -11,20 +28,20 @@
11
28
 
12
29
  ### Features
13
30
 
14
- - move `order-properties` from `recommended` to `stylistic` config ([#1475](undefined/undefined/undefined/issues/1475)) b9a9978, closes #1471
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)
15
32
 
16
33
  ## [0.86.0](///compare/v0.85.0...v0.86.0) (2025-12-30)
17
34
 
18
35
  ### Features
19
36
 
20
- - remove deprecated valid-local-dependency rule ([#1450](undefined/undefined/undefined/issues/1450)) 3e36e30, closes #1168
21
- - **valid-module:** add rule to validate `module` ([#1462](undefined/undefined/undefined/issues/1462)) ee376e0, closes #1034
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)
22
39
 
23
40
  ## [0.85.0](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.84.0...v0.85.0) (2025-11-18)
24
41
 
25
42
  ### Features
26
43
 
27
- - **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)), closes [#000](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/000)
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))
28
45
 
29
46
  ## [0.84.0](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/compare/v0.83.0...v0.84.0) (2025-11-18)
30
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: 36" src="https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-36-21bb42.svg" /></a>
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>
@@ -227,6 +227,7 @@ The default settings don't conflict, and Prettier plugins can quickly fix up ord
227
227
  | [require-name](docs/rules/require-name.md) | Requires the `name` property to be present. | βœ”οΈ βœ… πŸ“¦ | | | |
228
228
  | [require-optionalDependencies](docs/rules/require-optionalDependencies.md) | Requires the `optionalDependencies` property to be present. | | | | |
229
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. | πŸ“¦ | | | |
230
231
  | [require-sideEffects](docs/rules/require-sideEffects.md) | Requires the `sideEffects` property to be present. | πŸ“¦ | | | |
231
232
  | [require-type](docs/rules/require-type.md) | Requires the `type` property to be present. | βœ”οΈ βœ… πŸ“¦ | | | |
232
233
  | [require-types](docs/rules/require-types.md) | Requires the `types` property to be present. | | | | |
@@ -323,38 +324,39 @@ Thanks! πŸ—‚
323
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>
324
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>
325
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>
326
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>
327
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>
328
- <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>
329
330
  </tr>
330
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>
331
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>
332
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>
333
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>
334
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>
335
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>
336
- <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></td>
337
- <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>
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>
338
339
  </tr>
339
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>
340
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>
341
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>
342
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>
343
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>
344
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>
345
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>
346
- <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>
347
348
  </tr>
348
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>
349
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>
350
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>
351
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>
352
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>
353
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>
354
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>
355
- <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>
356
357
  </tr>
357
358
  <tr>
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>
358
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>
359
361
  </tr>
360
362
  </tbody>
@@ -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 githubUrlRegex = /^(?:git\+)?(?:ssh:\/\/git@|http?s:\/\/)?(?:www\.)?github\.com\//;
7
- const isGitHubUrl = (url) => githubUrlRegex.test(url);
8
- const cleanGitHubUrl = (url) => url.replace(githubUrlRegex, "").replace(/\.git$/, "");
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: `https://github.com/${node.value.value}`
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
- if (typeof value === "string" && isGitHubUrl(value)) context.report({
53
+ const provider$1 = getProviderFromUrl(value);
54
+ if (provider$1) context.report({
29
55
  fix(fixer) {
30
- return fixer.replaceText(node.value, JSON.stringify(cleanGitHubUrl(value)));
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" || !isGitHubUrl(urlProperty.value.value)) return;
69
+ if (urlProperty?.value.type !== "JSONLiteral" || typeof urlProperty.value.value !== "string") return;
44
70
  const url = urlProperty.value.value;
45
- context.report({
71
+ const provider = getProviderFromUrl(url);
72
+ if (provider) context.report({
46
73
  fix(fixer) {
47
- return fixer.replaceText(node.value, JSON.stringify(cleanGitHubUrl(url)));
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 GitHub repository."
96
+ preferShorthand: "Prefer a shorthand locator for a supported repository provider."
70
97
  },
71
98
  schema: [{
72
99
  additionalProperties: false,
@@ -23,6 +23,10 @@ const properties = [
23
23
  }],
24
24
  ["optionalDependencies"],
25
25
  ["peerDependencies"],
26
+ ["repository", {
27
+ category: "Publishable",
28
+ ignorePrivateDefault: true
29
+ }],
26
30
  ["sideEffects", { category: "Publishable" }],
27
31
  ["type", { isRecommended: true }],
28
32
  ["types"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-package-json",
3
- "version": "0.87.1",
3
+ "version": "0.88.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": {
@@ -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.0",
52
- "package-json-validator": "~0.59.0",
52
+ "package-json-validator": "~0.59.1",
53
53
  "semver": "^7.7.3",
54
54
  "sort-object-keys": "^2.0.0",
55
55
  "sort-package-json": "^3.4.0",
@@ -74,7 +74,7 @@
74
74
  "eslint-plugin-markdown-links": "0.7.1",
75
75
  "eslint-plugin-n": "17.23.1",
76
76
  "eslint-plugin-node-dependencies": "1.3.0",
77
- "eslint-plugin-perfectionist": "5.1.0",
77
+ "eslint-plugin-perfectionist": "5.2.0",
78
78
  "eslint-plugin-regexp": "2.10.0",
79
79
  "eslint-plugin-unicorn": "62.0.0",
80
80
  "eslint-plugin-yml": "1.19.0",
@@ -87,11 +87,10 @@
87
87
  "prettier": "3.7.0",
88
88
  "prettier-plugin-curly": "0.4.0",
89
89
  "prettier-plugin-packagejson": "2.5.19",
90
- "prettier-plugin-sentences-per-line": "0.2.0",
91
90
  "prettier-plugin-sh": "0.18.0",
92
91
  "tsdown": "0.18.0",
93
92
  "typescript": "5.9.3",
94
- "typescript-eslint": "8.50.0",
93
+ "typescript-eslint": "8.51.0",
95
94
  "vitest": "4.0.13"
96
95
  },
97
96
  "peerDependencies": {