@sap/eslint-plugin-cds 3.1.1 → 3.1.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.
package/CHANGELOG.md CHANGED
@@ -6,12 +6,19 @@ This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
7
  The format is based on [Keep a Changelog](http://keepachangelog.com/).
8
8
 
9
+ ## [3.1.2] - 2024-10-31
10
+
11
+ ### Fixed
12
+
13
+ - run inferred rules correctly on Microsoft Windows
14
+
15
+
9
16
  ## [3.1.1] - 2024-10-08
10
17
 
11
18
  ### Changed
12
19
 
13
20
  - `no-db-keywords` is no longer part of the 'recommended' rules,
14
- as the cds-compiler takes care of quoting SQL keywords, if they are used as identifiers.
21
+ as the cds-compiler takes care of quoting SQL keywords, if they are used as identifiers.
15
22
 
16
23
  ### Fixed
17
24
 
package/lib/index.js CHANGED
@@ -16,8 +16,6 @@
16
16
  * - Expose any 'rules' for use in ESLint
17
17
  */
18
18
 
19
- const path = require('node:path')
20
-
21
19
  const api = require('./api')
22
20
  const getConfigs = require('./conf')
23
21
  const rules = Object.assign(
@@ -25,7 +23,7 @@ const rules = Object.assign(
25
23
  ...Object.entries(require('./rules')).map(([k, v]) => ({ [k]: v() }))
26
24
  )
27
25
 
28
- const packageJson = require(path.join(__dirname, '../package.json'))
26
+ const packageJson = require('../package.json')
29
27
 
30
28
  const plugin = {
31
29
  meta: {
package/lib/parser.js CHANGED
@@ -15,8 +15,13 @@ const Cache = require('./utils/Cache')
15
15
  const LOG = cds.debug('lint:plugin')
16
16
  const colors = require('./utils/Colors')
17
17
  const { splitDefName } = require('./utils/rules')
18
+ const packageJson = require('../package.json')
18
19
 
19
20
  module.exports = {
21
+ meta: {
22
+ name: packageJson.name,
23
+ version: packageJson.version
24
+ },
20
25
  parse: function (code, options) {
21
26
  return module.exports.parseForESLint(code, options).ast
22
27
  },
@@ -105,11 +105,11 @@ module.exports = function createRule(spec) {
105
105
  }
106
106
 
107
107
  function isRunningWithCDSLint () {
108
- return process.argv[0].endsWith('node') && process.argv[1].endsWith('cds') && process.argv[2] === 'lint'
108
+ return process.argv[1].match(/cds(\.js)?$/) && process.argv[2]?.toLowerCase() === 'lint'
109
109
  }
110
110
 
111
111
  function isRunningWithESLint () {
112
- return process.argv[0].endsWith('node') && process.argv[1].endsWith('eslint')
112
+ return process.argv[1].match(/eslint(\.js)?$/)
113
113
  }
114
114
 
115
115
  function checkEntryCriteria (meta, cdscontext) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/eslint-plugin-cds",
3
- "version": "3.1.1",
3
+ "version": "3.1.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": [