no-caret-version-dependencies
Enabling this rule will result in an error being generated if one of the dependencies in dependencies
uses caret versions.
Example .npmpackagejsonlintrc configuration
{
"rules": {
"no-caret-version-dependencies": "error"
}
}
With exceptions
{
"rules": {
"no-caret-version-dependencies": ["error", {
"exceptions": ["myModule"]
}]
}
}
Rule Details
Incorrect example(s)
{
"dependencies": {
"gulp-npm-package-json-lint": "^0.3.0"
}
}
Correct example(s)
{
"dependencies": {
"gulp-npm-package-json-lint": "~0.3.0"
}
}
{
"dependencies": {
"gulp-npm-package-json-lint": ">=0.3.0"
}
}
{
"dependencies": {
"gulp-npm-package-json-lint": "<=0.3.0"
}
}
{
"dependencies": {
"gulp-npm-package-json-lint": "*"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "0.3.0"
}
}
{
"dependencies": {
"grunt-npm-package-json-lint": "=0.3.0"
}
}
Shorthand for disabling the rule in .npmpackagejsonlintrc configuration
{
"rules": {
"no-caret-version-dependencies": "off"
}
}
History
- Improved messaging when an invalid configuration is detected in version 6.3.0
- Introduced in version 3.2.0