From c58458087a6a4b22ad991da766d1df182b3bd6f4 Mon Sep 17 00:00:00 2001 From: Daniel O'Grady <103028279+daogrady@users.noreply.github.com> Date: Mon, 24 Feb 2025 14:09:33 +0100 Subject: [PATCH] Remove use of globals package with mirrored values from sap/cds (#499) --- eslint.config.js | 15 +++++++++------ package-lock.json | 14 -------------- package.json | 1 - 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 11428c5c..ab4e0b1e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,7 +1,11 @@ -module.exports = [ - // +// aiife to allow dynamic import of cds/eslint.config.mjs +module.exports = (async () => [ { - ignores: ['**/test/integration/**'], + ignores: [ + '**/test/integration/**', + '**/test/**/_out', // no auto-transpiled test files + '**/@cds-models' // no generated model files + ], }, require('@eslint/js').configs.recommended, require('eslint-plugin-jsdoc').configs['flat/recommended-typescript-flavor-error'], @@ -10,8 +14,7 @@ module.exports = [ ecmaVersion: 'latest', sourceType: 'commonjs', globals: { - ...require('globals').node, - jest: true + ...(await import('@sap/cds/eslint.config.mjs')).defaults.languageOptions.globals } }, files: ['**/*.js'], @@ -92,4 +95,4 @@ module.exports = [ 'jsdoc/require-returns': 'off', // lsp can infer this most of the time, turn back on for doc extraction } } -] \ No newline at end of file +])() \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ad2a75df..aa62aa1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,6 @@ "acorn": "^8.10.0", "eslint": "^9", "eslint-plugin-jsdoc": "^50.2.2", - "globals": "^15.0.0", "typescript": ">=4.6.4" }, "peerDependencies": { @@ -1411,19 +1410,6 @@ "node": ">=10.13.0" } }, - "node_modules/globals": { - "version": "15.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", - "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", diff --git a/package.json b/package.json index 44a3a9d9..f2eb2c1a 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,6 @@ "acorn": "^8.10.0", "eslint": "^9", "eslint-plugin-jsdoc": "^50.2.2", - "globals": "^15.0.0", "typescript": ">=4.6.4" }, "cds": {