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 optionallydirectoryproperties typeanddirectory, if present, should be non-empty stringsurlshould be a valid repo URL- If it’s a string, it should be the shorthand repo string from a supported provider
Examples
Section titled “Examples”{ "repository": { "url": "git+https://github.com/michaelfaith/eslint-plugin-package-json.git" }}{ "repository": "github:michaelfaith/eslint-plugin-package-json"}{ "repository": { "type": "git", "url": "git+https://github.com/michaelfaith/eslint-plugin-package-json.git" }}Related Rules
Section titled “Related Rules”require-repository- Enforces that therepositoryproperty is present.