Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 1000 Bytes

File metadata and controls

40 lines (31 loc) · 1000 Bytes

valid-repository

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

This rule does the following checks on the value of the bin property:

  • It should be of type object or string.
  • If it's an object, it should have type, url, and optionally directory.
  • 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.

Example of incorrect code for this rule:

{
	"repository": {
		"url": "git+https://github.com/michaelfaith/eslint-plugin-package-json.git"
	}
}

Example of correct code for this rule:

{
	"repository": "github:michaelfaith/eslint-plugin-package-json"
}
{
	"repository": {
		"type": "git",
		"url": "git+https://github.com/michaelfaith/eslint-plugin-package-json.git"
	}
}