Skip to main content

prefer-tilde-version-dependencies

Enabling this rule will result in an error being generated if one of the dependencies in dependencies is does not use a tilde version range.

Example .npmpackagejsonlintrc configuration

{
"rules": {
"prefer-tilde-version-dependencies": "error"
}
}

With exceptions

{
"rules": {
"prefer-tilde-version-dependencies": ["error", {
"exceptions": ["myModule"]
}]
}
}

Rule Details

Incorrect example(s)

{
"dependencies": {
"grunt-npm-package-json-lint": "^0.3.0"
}
}

Correct example(s)

{
"dependencies": {
"gulp-npm-package-json-lint": "~0.3.0"
}
}

History

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