latest-cds-version
Rule Details
It's recommended to always use the latest version of @sap/cds
to benefit from the latest features and bug fixes. This rule checks whether the latest @sap/cds
version is being used and reports back in case a newer version is available.
Examples
Let's suppose the latest version of @sap/cds
available is 7.8.0
.
✅ Correct example
If the current version in your environment is 7.8.0
, the rule passes and there's no output.
❌ Incorrect example
If the current version in your environment is 7.0.0
, that is what the command npm outdated @sap/cds
returns:
Package Current Wanted Latest Location Depended by@sap/cds 7.0.07.8.0 7.8.0 node_modules/@sap/cds latest-cds-version
Then the rule is triggered and prints the following output upon calling cds lint
in the directory of your project (for example, YOUR_PROJECT_PATH):
/YOUR_PROJECT_PATH 1:1 error A newer CDS version is available!@sap/cds/latest-cds-version ✖ 1 problem (1 error, 0 warnings)
Version
This rule was introduced in @sap/eslint-plugin-cds 1.0.4
.