@sap/eslint-plugin-cds 3.2.0 → 4.0.2

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.
@@ -5,7 +5,7 @@
5
5
  const fs = require('node:fs')
6
6
  const path = require('node:path')
7
7
 
8
- const { Linter, RuleTester } = require('eslint')
8
+ const { RuleTester } = require('eslint')
9
9
  const { globalCache } = require('./Cache')
10
10
  const isConfiguredFileType = require('./isConfiguredFileType')
11
11
  const { compileModelFromDict } = require('../parser')
@@ -56,6 +56,7 @@ module.exports = function runRuleTester(options) {
56
56
  rule = testRuleWrapper(rules[path.basename(options.root)]())
57
57
  } else {
58
58
  // Otherwise from project root
59
+
59
60
  // eslint-disable-next-line
60
61
  const resolvedPlugin = require.resolve('@sap/eslint-plugin-cds', {
61
62
  paths: [options.root]
@@ -66,9 +67,7 @@ module.exports = function runRuleTester(options) {
66
67
 
67
68
  let tester
68
69
  if (parserPath) {
69
- const options = _isEslint9OrLater()
70
- ? { languageOptions: { parser: require(parserPath) } }
71
- : { parser: parserPath }
70
+ const options = { languageOptions: { parser: require(parserPath) } }
72
71
  tester = new RuleTester(options)
73
72
  } else {
74
73
  tester = new RuleTester()
@@ -82,10 +81,7 @@ module.exports = function runRuleTester(options) {
82
81
  filename: filePath,
83
82
  }
84
83
  ]
85
- if (_isEslint9OrLater()) {
86
- // property not supported for ESLint 8
87
- testerCases[type][0].name = `${path.basename(options.root)}/${type}/${options.filename}`
88
- }
84
+ testerCases[type][0].name = `${path.basename(options.root)}/${type}/${options.filename}`
89
85
  if (!isConfiguredFileType(options.filename, 'FILES')) {
90
86
  const fileContents = JSON.parse(fs.readFileSync(filePath, 'utf8'))
91
87
  testerCases[type][0].code = ''
@@ -150,7 +146,3 @@ function _getDictFiles(input, filenames) {
150
146
  }
151
147
  return dictFiles
152
148
  }
153
-
154
- function _isEslint9OrLater() {
155
- return Number(Linter.version.split('.')[0]) >= 9
156
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/eslint-plugin-cds",
3
- "version": "3.2.0",
3
+ "version": "4.0.2",
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,13 +20,13 @@
20
20
  "README.md"
21
21
  ],
22
22
  "dependencies": {
23
- "@sap/cds": ">=7",
24
23
  "semver": "^7.7.1"
25
24
  },
26
25
  "peerDependencies": {
27
- "eslint": ">=8"
26
+ "@sap/cds": ">=9",
27
+ "eslint": "^9"
28
28
  },
29
29
  "engines": {
30
- "node": ">=18"
30
+ "node": ">=20"
31
31
  }
32
32
  }