@sap/eslint-plugin-cds 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -54
- package/lib/impl/constants.js +1 -11
- package/lib/impl/index.js +6 -1
- package/lib/impl/ruleFactory.js +44 -14
- package/lib/impl/rules/assoc2many-ambiguous-key.js +4 -2
- package/lib/impl/rules/cds-compile-error.js +21 -22
- package/lib/impl/rules/latest-cds-version.js +6 -1
- package/lib/impl/rules/min-node-version.js +3 -1
- package/lib/impl/rules/no-db-keywords.js +3 -0
- package/lib/impl/rules/no-join-on-draft-enabled-entities.js +3 -1
- package/lib/impl/rules/require-2many-oncond.js +3 -1
- package/lib/impl/rules/sql-cast-suggestion.js +3 -1
- package/lib/impl/rules/start-elements-lowercase.js +3 -2
- package/lib/impl/rules/start-entities-uppercase.js +2 -2
- package/lib/impl/rules/valid-csv-header.js +92 -0
- package/lib/impl/utils/fuzzySearch.js +87 -0
- package/lib/impl/utils/model.js +52 -26
- package/lib/impl/utils/rules.js +269 -141
- package/lib/impl/utils/validate.js +6 -3
- package/package.json +2 -2
|
@@ -19,14 +19,17 @@ module.exports = {
|
|
|
19
19
|
},
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Checks whether a
|
|
22
|
+
* Checks whether a cds model is error-free
|
|
23
23
|
* @param context cds context object
|
|
24
24
|
* @returns
|
|
25
25
|
*/
|
|
26
26
|
isValidModel: function (context) {
|
|
27
27
|
const cds = context.cds;
|
|
28
|
-
if (cds
|
|
29
|
-
|
|
28
|
+
if (cds) {
|
|
29
|
+
if (cds.model) {
|
|
30
|
+
return !cds.model.err;
|
|
31
|
+
}
|
|
32
|
+
return true; // allow no model
|
|
30
33
|
}
|
|
31
34
|
return false;
|
|
32
35
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/eslint-plugin-cds",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "ESLint plugin including recommended SAP Cloud Application Programming model and environment rules",
|
|
5
5
|
"homepage": "https://cap.cloud.sap/",
|
|
6
6
|
"keywords": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@sap/cds": "^5.
|
|
23
|
+
"@sap/cds": "^5.6.0",
|
|
24
24
|
"semver": "^7.3.4"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|