diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 159dd3373..000000000 --- a/.eslintrc +++ /dev/null @@ -1,54 +0,0 @@ -{ - "env": { - "browser": true - }, - "globals": { - "sap": true, - "jQuery": true - }, - "rules": { - "block-scoped-var": 1, - "brace-style": [2, "1tbs", { "allowSingleLine": true }], - "consistent-this": 2, - "no-div-regex": 2, - "no-floating-decimal": 2, - "no-self-compare": 2, - "no-mixed-spaces-and-tabs": [2, true], - "no-nested-ternary": 2, - "no-unused-vars": [2, {"vars":"all", "args":"none"}], - "radix": 2, - "keyword-spacing": 2, - "space-unary-ops": 2, - "wrap-iife": [2, "any"], - - "camelcase": 1, - "consistent-return": 1, - "max-nested-callbacks": [1, 3], - "new-cap": 1, - "no-extra-boolean-cast": 1, - "no-lonely-if": 1, - "no-new": 1, - "no-new-wrappers": 1, - "no-redeclare": 1, - "no-unused-expressions": 1, - "no-use-before-define": [1, "nofunc"], - "no-warning-comments": 1, - "strict": 1, - "valid-jsdoc": [1, { - "requireReturn": false - }], - "default-case": 1, - - "dot-notation": 0, - "eol-last": 0, - "eqeqeq": 0, - "no-trailing-spaces": 0, - "no-underscore-dangle": 0, - "quotes": 0, - "key-spacing": 0, - "comma-spacing": 0, - "no-multi-spaces": 0, - "no-shadow": 0, - "no-irregular-whitespace": 0 - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..b69a83272 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,77 @@ +import globals from "globals"; + +export default [ + { + languageOptions: { + globals: { + ...globals.browser, + sap: true, + jQuery: true, + }, + ecmaVersion: 5, + sourceType: "script", + }, + + rules: { + "block-scoped-var": 1, + + "brace-style": [ + 2, + "1tbs", + { + allowSingleLine: true, + }, + ], + + "consistent-this": 2, + "no-div-regex": 2, + "no-floating-decimal": 2, + "no-self-compare": 2, + "no-mixed-spaces-and-tabs": [2, true], + "no-nested-ternary": 2, + + "no-unused-vars": [ + 2, + { + vars: "all", + args: "none", + }, + ], + + radix: 2, + "keyword-spacing": 2, + "space-unary-ops": 2, + "wrap-iife": [2, "any"], + camelcase: 1, + "consistent-return": 1, + "max-nested-callbacks": [1, 3], + "new-cap": 1, + "no-extra-boolean-cast": 1, + "no-lonely-if": 1, + "no-new": 1, + "no-new-wrappers": 1, + "no-redeclare": 1, + "no-unused-expressions": 1, + "no-use-before-define": [1, "nofunc"], + "no-warning-comments": 1, + strict: 1, + + // This rule must be disabled as of ESLint 9. It's removed and causes issues when present. + // https://eslint.org/docs/latest/rules/valid-jsdoc + "valid-jsdoc": 0, + + "default-case": 1, + "dot-notation": 0, + "eol-last": 0, + eqeqeq: 0, + "no-trailing-spaces": 0, + "no-underscore-dangle": 0, + quotes: 0, + "key-spacing": 0, + "comma-spacing": 0, + "no-multi-spaces": 0, + "no-shadow": 0, + "no-irregular-whitespace": 0, + }, + }, +]; diff --git a/package-lock.json b/package-lock.json index 1cb72658a..68ca6043d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,12 @@ "version": "0.1.0", "devDependencies": { "@ui5/cli": "^3.11.0", +<<<<<<< Updated upstream "eslint": "^9.8.0", +======= + "eslint": "^8.57.0", + "globals": "^15.8.0", +>>>>>>> Stashed changes "karma": "^6.4.3", "karma-chrome-launcher": "^3.2.0", "karma-coverage": "^2.2.1", @@ -617,6 +622,22 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@eslint/js": { "version": "9.8.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.8.0.tgz", @@ -9706,6 +9727,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -10361,10 +10398,18 @@ } }, "node_modules/globals": { +<<<<<<< Updated upstream "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, +======= + "version": "15.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.8.0.tgz", + "integrity": "sha512-VZAJ4cewHTExBWDHR6yptdIBlx9YSSZuwojj9Nt5mBRXQzrKakDsVKQ1J63sklLvzAJm0X5+RpO4i3Y2hcOnFw==", + "dev": true, + "license": "MIT", +>>>>>>> Stashed changes "engines": { "node": ">=18" }, @@ -13846,6 +13891,22 @@ "node": ">= 0.8.0" } }, +<<<<<<< Updated upstream +======= + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, +>>>>>>> Stashed changes "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", diff --git a/package.json b/package.json index 7ac6e5523..0c6589cb8 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,12 @@ }, "devDependencies": { "@ui5/cli": "^3.11.0", +<<<<<<< Updated upstream "eslint": "^9.8.0", +======= + "eslint": "^8.57.0", + "globals": "^15.8.0", +>>>>>>> Stashed changes "karma": "^6.4.3", "karma-chrome-launcher": "^3.2.0", "karma-coverage": "^2.2.1",