💼 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
objectorstring. - If it's an
object, it should havetype,url, and optionallydirectory. 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.
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"
}
}