node-dependencies/compat-engines
enforce the versions of the engines of the dependencies to be compatible.
- ⚙️ This rule is included in
"plugin:node-dependencies/recommended"
.
📖 Rule Details
This rule checks the engines
of the dependencies and reports if they are compatible with the engines
defined in package.json.
jsonc
/* eslint "node-dependencies/compat-engines": "error" */
{
"engines": {
"node": ">=8"
},
"dependencies": {
"semver": "^7.3.5" /* ✗ BAD: node>=10 is required. */
}
}
🔧 Options
json
{
"node-dependencies/compat-engines": ["error", {
"deep": true,
"comparisonType": "normal"
}]
}
deep
... Iftrue
, if the dependency does not haveengines
, it will be checked further dependencies.comparisonType
... Defines the comparison method. Default is"normal"
"normal"
... This is the normal comparison method."major"
... If the versions match in the major version, it is considered a match. For example,node@>=10
allows dependency modules fornode@>=10.12
.
🚀 Version
This rule was introduced in eslint-plugin-node-dependencies v0.5.0