Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Bring in a valid-peerDependencies rule #835

Open
3 tasks done
JoshuaKGoldberg opened this issue Feb 1, 2025 · 3 comments
Open
3 tasks done

🚀 Feature: Bring in a valid-peerDependencies rule #835

JoshuaKGoldberg opened this issue Feb 1, 2025 · 3 comments
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request

Comments

@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Feb 1, 2025

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Following #42 -> #51: we've resolved to create a standalone valid-peerDependencies rule. It should enforce that, if the field exists in the package.json file, it's set to a valid value. It should do nothing if the field doesn't exist.

Additional Info

Per discussion in #51, this won't be enabled by default at first. The valid-package-def rule already contains this logic using package-json-validator. For this issue, we should:

  1. Send a PR to create the rule in this repo (resolving this issue)
  2. File an issue on https://github.com/JoshuaKGoldberg/package-json-validator to create a standalone API that performs the same validation
  3. Once a version of package-json-validator is released with that feature, file an issue on this repo to switch the rule to use that API from package-json-validator

If you want to take on just step 1, that's ok - no pressure to do all three. 🙂

Once all valid- rules exist in this plugin, we can then file an issue to deprecate the valid-package-def rule in favor of them.

💖

@JoshuaKGoldberg JoshuaKGoldberg added status: blocked Waiting for something else to be resolved type: feature New enhancement or request labels Feb 1, 2025
@michaelfaith
Copy link
Collaborator

What do think about possibly collapsing the valid peer- dev- and dependencies into a single rule valid-dependencies rule?

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! and removed status: blocked Waiting for something else to be resolved labels Feb 2, 2025
@JoshuaKGoldberg
Copy link
Owner Author

Note: michaelfaith and I talked over the strategy. I'd initially put that the validation API should exist in package-json-validator first, then be ported here. Michael suggested letting folks make it here first for an easier contribution process and faster determining whether how the API should look the rule. I agree, that's much better 😄. Edited.

@JoshuaKGoldberg
Copy link
Owner Author

What do think about possibly collapsing the valid peer- dev- and dependencies into a single rule valid-dependencies rule?

Hmm, that's an interesting idea. I think I prefer it. I can't think of a scenario where someone would want to validate only some of those properties, not all of them... The one sticking point would be that it'd become the only rule that applies to multiple discrete properties - rather than one property, or one property + its aliases. But I don't think that that's a major problem. We can also always split it out later on if we realize it should be.

WDYT @michaelfaith?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request
Projects
None yet
Development

No branches or pull requests

2 participants