Skip to content

valid-repository

💼 This rule is enabled in the following configs: ✅ recommended, 📦 recommended-publishable.

This rule uses package-json-validator to validate the repository property, if present, against the following criteria:

  • It should be an object or a string
  • If it’s an object, it should have type, url, and optionally directory properties
  • type and directory, if present, should be non-empty strings
  • url should be a valid repo URL
  • If it’s a string, it should be the shorthand repo string from a supported provider
{
"repository": {
"url": "git+https://github.com/michaelfaith/eslint-plugin-package-json.git"
}
}