-
Notifications
You must be signed in to change notification settings - Fork 28
🚀 Feature: Require schema to be present #935
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
Comments
Seems reasonable to have that as a new rule available for people to opt into, but not included in the recommended config. If we're going to include a fixer that adds it, then probably should have the schema url be configurable. Though our other require-x rules don't have fixers that add anything... |
Thanks for the quick response! I think it makes sense to have it opt-in, quite possibly some people don’t want the schema to be declared in the file. Looking at the autofix, it’s definitely a more special case as the autofix in other ones doesn’t make much sense, but here the value could be “fixed”, although I don’t see why a config couldn’t contain a rule for requiring a specific license, perhaps in a monorepo. Following this chain of thought, I would definitely make it configurable. |
@JoshuaKGoldberg curious about your thoughts. In general, but especially on the issue of having a fixer for this, since we have traditionally kept the |
🤔 I'm not convinced this is a common or necessary enough practice to justify including in this package. "Common": This Sourcegraph search for the schemastore string in "Necessary": As I understand it, there are two benefits:
-1 from me right now, but I'm open to being convinced. What real benefits are there for many users from including a |
Bug Report Checklist
main
branch of the repository.Overview
Hi 👋,
While this tool does a pretty good job of keeping package.json free of typos by validating the contents, for manual editing a
$schema
is sometimes useful. Most of my package.json files contain a"$schema": "https://json.schemastore.org/package.json",
line so that they can be validated in CI. What do you think about adding a rule that adds $schema to package.json?Additional Info
No response
The text was updated successfully, but these errors were encountered: