Skip to main content

no-git-dependencies

Enabling this rule will result in an error being generated if one of the dependencies in dependencies uses git repository.

Example .npmpackagejsonlintrc configuration

{
"rules": {
"no-git-dependencies": "error"
}
}

With exceptions

{
"rules": {
"no-git-dependencies": ["error", {
"exceptions": ["myModule"]
}]
}
}

Rule Details

Incorrect examples

{
"dependencies": {
"grunt-npm-package-json-lint": "github:miripiruni/grunt-npm-package-json-lint"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "miripiruni/grunt-npm-package-json-lint"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "miripiruni/grunt-npm-package-json-lint#miri/issue-42"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "miripiruni/grunt-npm-package-json-lint#v1.0.0-rc-1"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "miripiruni/grunt-npm-package-json-lint#4f9012b132aa4d2d6097b516b31327c999b0a846"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "git://github.com/miripiruni/grunt-npm-package-json-lint.git"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "git@github.com:miripiruni/grunt-npm-package-json-lint.git"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "git+https://github.com/miripiruni/grunt-npm-package-json-lint.git"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "git+ssh://github.com/miripiruni/grunt-npm-package-json-lint.git"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "http://github.com/miripiruni/grunt-npm-package-json-lint.git"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "https://github.com/miripiruni/grunt-npm-package-json-lint.git"
}
}

Correct example(s)

{
"dependencies": {
"gulp-npm-package-json-lint": "4.0.0"
}
}
{
"dependencies": {
"gulp-npm-package-json-lint": "^4.0.0"
}
}
{
"dependencies": {
"gulp-npm-package-json-lint": "~4.0.0"
}
}
{
"dependencies": {
"gulp-npm-package-json-lint": ">=4.0.0"
}
}
{
"dependencies": {
"gulp-npm-package-json-lint": "<=4.0.0"
}
}
{
"dependencies": {
"gulp-npm-package-json-lint": "*"
}
}

Shorthand for disabling the rule in .npmpackagejsonlintrc configuration

{
"rules": {
"no-git-dependencies": "off"
}
}

History

  • Improved messaging when an invalid configuration is detected in version 6.3.0
  • Introduced in version 4.3.0