From 860248c0035f6dfb994e72eed8792b19576a706c Mon Sep 17 00:00:00 2001 From: antti-manninen-vmv Date: Fri, 31 Oct 2025 14:49:54 +0200 Subject: [PATCH 1/2] Upgrade to eslint 9 --- .eslintignore | 1 - .eslintrc.json | 11 - eslint.config.js | 14 + package-lock.json | 467 +++++++++--------- package.json | 2 +- packages/answer-utils/package.json | 2 +- packages/async-utils/package.json | 2 +- .../__tests__/crypto-utils.test.ts | 2 +- packages/crypto-utils/package.json | 2 +- packages/crypto-utils/src/index.ts | 2 +- packages/database-utils/package.json | 2 +- packages/eslint-config/package.json | 2 +- packages/eslint-config/src/index.js | 239 +++++---- packages/examination-utils/package.json | 2 +- packages/express-utils/package.json | 2 +- packages/fetch/package.json | 2 +- packages/json-exam-utils/package.json | 2 +- packages/logger/package.json | 2 +- packages/passphrase-generator/package.json | 2 +- .../passport-saml-cache-postgres/package.json | 2 +- packages/passport-utils/package.json | 2 +- packages/saml-mock/package.json | 2 +- packages/testing/package.json | 2 +- packages/validation/package.json | 2 +- packages/zip-utils/package.json | 2 +- 25 files changed, 420 insertions(+), 352 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 7773828..0000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist/ \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index f58b171..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "@digabi/eslint-config", - "overrides": [ - { - "files": ["*.test.ts"], - "rules": { - "@typescript-eslint/no-floating-promises": "off" - } - } - ] -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..623eaec --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,14 @@ +import digabi from '@digabi/eslint-config' + +export default [ + ...[digabi].flat(), + { + ignores: ['**/dist/', '**/node_modules/'] + }, + { + files: ['**/*.test.ts'], + rules: { + '@typescript-eslint/no-floating-promises': 'off' + } + } +] diff --git a/package-lock.json b/package-lock.json index 3e33382..5063716 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@types/node": "^24.1.0", "@typescript-eslint/eslint-plugin": "^8.38.0", "@typescript-eslint/parser": "^8.38.0", - "eslint": "^8.45.0", + "eslint": "^9.38.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", "eslint-plugin-prettier": "^5.5.3", @@ -70,7 +70,6 @@ "integrity": "sha512-UlLAnTPrFdNGoFtbSXwcGFQBtQZJCNjaN6hQNP3UPvuNXT1i82N26KL3dZeIpNalWywr9IuQuncaAfUaS1g6sQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1159,9 +1158,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.4.3" @@ -1185,16 +1184,88 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", + "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers/node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.16.0.tgz", + "integrity": "sha512-nmC8/totwobIiFcGkDza3GIKfAw1+hLiYVrh3I1nIomQ8PEr5cxg34jnkmGawul/ep52wGRAcyeDCNtWKSOj4Q==", + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -1202,7 +1273,7 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1240,12 +1311,49 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.38.0.tgz", + "integrity": "sha512-UZ1VpFvXf9J06YG9xQBdnzU+kthors6KjhMAl6f4gH4usHyh31rUf2DLGInT8RFYIReYXNSydgPY0V2LuWgl7A==", "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@grpc/grpc-js": { @@ -1281,41 +1389,26 @@ "node": ">=6" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "license": "Apache-2.0", - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" - }, "engines": { - "node": ">=10.10.0" + "node": ">=18.18.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "license": "ISC", + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "license": "Apache-2.0", "dependencies": { - "brace-expansion": "^1.1.7" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" }, "engines": { - "node": "*" + "node": ">=18.18.0" } }, "node_modules/@humanwhocodes/module-importer": { @@ -1331,12 +1424,18 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", - "license": "BSD-3-Clause" + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@hutson/parse-repository-url": { "version": "3.0.2", @@ -3679,7 +3778,6 @@ "integrity": "sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", @@ -4261,6 +4359,12 @@ "@types/ssh2": "*" } }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "license": "MIT" + }, "node_modules/@types/express": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.3.tgz", @@ -4317,6 +4421,12 @@ "@types/istanbul-lib-report": "*" } }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "license": "MIT" + }, "node_modules/@types/json2csv": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/@types/json2csv/-/json2csv-5.0.7.tgz", @@ -4585,7 +4695,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.39.1.tgz", "integrity": "sha512-yYegZ5n3Yr6eOcqgj2nJH8cH/ZZgF+l0YIdKILSDjYFRjgYQMgv/lRjV5Z7Up04b9VYUondt8EPMqg7kTWgJ2g==", "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.39.1", @@ -4615,7 +4724,6 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.39.1.tgz", "integrity": "sha512-pUXGCuHnnKw6PyYq93lLRiZm3vjuslIy7tus1lIQTYVK9bL8XBgJnCWm8a0KcTtHC84Yya1Q6rtll+duSMj0dg==", "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.39.1", "@typescript-eslint/types": "8.39.1", @@ -4810,6 +4918,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, "license": "ISC" }, "node_modules/@unrs/resolver-binding-android-arm-eabi": { @@ -5243,7 +5352,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -5350,6 +5458,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -6192,7 +6301,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001733", "electron-to-chromium": "^1.5.199", @@ -7568,18 +7676,6 @@ "tar-stream": "^2.1.4" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", @@ -8089,60 +8185,62 @@ } }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", - "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", - "license": "MIT", - "peer": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "version": "9.38.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.38.0.tgz", + "integrity": "sha512-t5aPOpmtJcZcz5UJyY2GbvpDlsK5E8JqRqoKtfiKE3cNh437KIqfJr3A3AKf5k64NPx6d0G3dno6XDY05PqPtw==", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.1", + "@eslint/config-helpers": "^0.4.1", + "@eslint/core": "^0.16.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.38.0", + "@eslint/plugin-kit": "^0.4.0", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-prettier": { @@ -8150,7 +8248,6 @@ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "license": "MIT", - "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -8212,7 +8309,6 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -8488,16 +8584,16 @@ } }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -8525,6 +8621,18 @@ "concat-map": "0.0.1" } }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -8547,17 +8655,29 @@ } }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.2.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -8889,15 +9009,15 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/filelist": { @@ -8979,17 +9099,16 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { @@ -9176,6 +9295,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, "license": "ISC" }, "node_modules/fsevents": { @@ -9582,15 +9702,12 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -10025,6 +10142,7 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -10429,15 +10547,6 @@ "node": ">=8" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -10789,7 +10898,6 @@ "integrity": "sha512-y2mfcJywuTUkvLm2Lp1/pFX8kTgMO5yyQGq/Sk/n2mN7XWYp4JsCZ/QXW34M8YScgk8bPZlREH04f6blPnoHnQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/core": "30.0.5", "@jest/types": "30.0.5", @@ -13885,7 +13993,6 @@ "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "@napi-rs/wasm-runtime": "0.2.4", "@yarnpkg/lockfile": "^1.1.0", @@ -14889,6 +14996,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -14974,7 +15082,6 @@ "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", "license": "MIT", - "peer": true, "dependencies": { "pg-connection-string": "^2.9.1", "pg-pool": "^3.10.1", @@ -15299,7 +15406,6 @@ "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -16085,65 +16191,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/router": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", @@ -17029,6 +17076,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -17395,12 +17443,6 @@ "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", "license": "MIT" }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "license": "MIT" - }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -17500,7 +17542,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -17766,18 +17807,6 @@ "node": ">=4" } }, - "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==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/type-is": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", @@ -17908,7 +17937,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -18811,7 +18839,6 @@ "integrity": "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 55e492e..6c6c0df 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@types/node": "^24.1.0", "@typescript-eslint/eslint-plugin": "^8.38.0", "@typescript-eslint/parser": "^8.38.0", - "eslint": "^8.45.0", + "eslint": "^9.38.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", "eslint-plugin-prettier": "^5.5.3", diff --git a/packages/answer-utils/package.json b/packages/answer-utils/package.json index 82281f1..633ffcd 100644 --- a/packages/answer-utils/package.json +++ b/packages/answer-utils/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "dependencies": { diff --git a/packages/async-utils/package.json b/packages/async-utils/package.json index a1648fc..016250d 100644 --- a/packages/async-utils/package.json +++ b/packages/async-utils/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/crypto-utils/__tests__/crypto-utils.test.ts b/packages/crypto-utils/__tests__/crypto-utils.test.ts index d08064b..c40dfe3 100644 --- a/packages/crypto-utils/__tests__/crypto-utils.test.ts +++ b/packages/crypto-utils/__tests__/crypto-utils.test.ts @@ -6,7 +6,7 @@ import { test, describe } from 'node:test' import assert from 'node:assert/strict' import { randomString } from '@digabi/testing' -const readStreamToBuffer = async (outputStream: Readable): Promise => +const readStreamToBuffer = (outputStream: Readable): Promise => new Promise((resolve, reject) => { const bufs: Buffer[] = [] outputStream.on('data', (d: Buffer) => bufs.push(d)) diff --git a/packages/crypto-utils/package.json b/packages/crypto-utils/package.json index e33d867..e15d4e1 100644 --- a/packages/crypto-utils/package.json +++ b/packages/crypto-utils/package.json @@ -15,7 +15,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "keywords": [ diff --git a/packages/crypto-utils/src/index.ts b/packages/crypto-utils/src/index.ts index b7eae89..e43c2f4 100644 --- a/packages/crypto-utils/src/index.ts +++ b/packages/crypto-utils/src/index.ts @@ -26,7 +26,7 @@ export function createAES256DecryptStreamWithIv(key: BufferOrString, iv: BufferO return crypto.createDecipheriv(symmetricAlgo, asBuffer(key), asBuffer(iv)) } -export async function signWithSHA256AndRSA(input: BufferOrStream, privateKeyPem: string): Promise { +export function signWithSHA256AndRSA(input: BufferOrStream, privateKeyPem: string): Promise { const signer = crypto.createSign(signAlgo) let inputStream diff --git a/packages/database-utils/package.json b/packages/database-utils/package.json index 3178568..374131e 100644 --- a/packages/database-utils/package.json +++ b/packages/database-utils/package.json @@ -17,7 +17,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "TZ=UTC node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index dbd8520..7335a73 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "echo 'No build needed'", "test": "echo 'No tests'", - "lint": "eslint -c ./src/index.js --ignore-path ../../.eslintignore ./src/index.js", + "lint": "eslint -c ./src/index.js ./src/index.js", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/eslint-config/src/index.js b/packages/eslint-config/src/index.js index 3edb2f5..dc16d30 100644 --- a/packages/eslint-config/src/index.js +++ b/packages/eslint-config/src/index.js @@ -1,8 +1,13 @@ -function hasDependency(module) { +import { fileURLToPath } from 'node:url' +import path from 'node:path' + +function hasDependency(mod) { try { - require.resolve(module) + const __filename = fileURLToPath(import.meta.url) + const __dirname = path.dirname(__filename) + require.resolve(mod, { paths: [__dirname] }) return true - } catch (err) { + } catch { return false } } @@ -12,107 +17,141 @@ const hasJest = hasDependency('eslint-plugin-jest') const hasReact = hasDependency('eslint-plugin-react') const hasReactHooks = hasDependency('eslint-plugin-react-hooks') -module.exports = { - extends: [ - 'eslint:recommended', - 'plugin:import/errors', - 'plugin:import/typescript', - 'plugin:promise/recommended', - hasMocha && 'plugin:mocha/recommended', - hasJest && 'plugin:jest/recommended', - hasJest && 'plugin:jest/style', - hasReact && 'plugin:react/recommended', - hasReactHooks && 'plugin:react-hooks/recommended', - 'plugin:prettier/recommended' - ].filter(Boolean), - parserOptions: { - ecmaVersion: 2020, - sourceType: 'module' - }, - env: { - browser: true, - node: true, - es2020: true, - ...(hasMocha && { mocha: true }) - }, - plugins: ['promise', hasMocha && 'mocha', hasJest && 'jest'].filter(Boolean), +import pluginImport from 'eslint-plugin-import' +import pluginPromise from 'eslint-plugin-promise' +import pluginPrettier from 'eslint-plugin-prettier' +import tsParser from '@typescript-eslint/parser' +import tsPlugin from '@typescript-eslint/eslint-plugin' + +const pluginMocha = hasMocha + ? ((await import('eslint-plugin-mocha')).default ?? (await import('eslint-plugin-mocha'))) + : null +const pluginJest = hasJest + ? ((await import('eslint-plugin-jest')).default ?? (await import('eslint-plugin-jest'))) + : null +const pluginReact = hasReact + ? ((await import('eslint-plugin-react')).default ?? (await import('eslint-plugin-react'))) + : null +const pluginReactHooks = hasReactHooks + ? ((await import('eslint-plugin-react-hooks')).default ?? (await import('eslint-plugin-react-hooks'))) + : null + +const sharedRules = { + 'array-callback-return': 'error', + 'arrow-body-style': ['error', 'as-needed'], + 'prefer-object-spread': 'error', + 'no-duplicate-imports': ['error', { includeExports: true }], + 'one-var': ['error', 'never'], + 'prefer-arrow-callback': ['error'], + 'prefer-destructuring': ['error', { array: false }], + 'prefer-template': ['error'], + 'require-await': 'error', + + 'import/default': 'off', + 'import/named': 'off', + 'import/namespace': 'off', + 'import/no-unresolved': 'off', + 'import/no-commonjs': ['warn'], + + 'promise/avoid-new': 'off', + 'promise/catch-or-return': ['error', { allowFinally: true }], + 'promise/no-callback-in-promise': 'off', + 'promise/no-nesting': 'off', + 'promise/prefer-await-to-then': ['warn'], + + 'prettier/prettier': 'error', + + 'no-restricted-imports': [ + 'warn', + { name: 'bluebird', message: 'Please use native promises instead.' }, + { name: 'ramda', message: 'Please use lodash or native javascript instead.' }, + { name: 'partial.lenses', message: 'Please use lodash or native javascript instead.' }, + { name: 'moment', message: 'Please use native Date() and date-fns instead.' } + ], - rules: { - 'array-callback-return': 'error', - 'arrow-body-style': ['error', 'as-needed'], - 'prefer-object-spread': 'error', - 'no-duplicate-imports': ['error', { includeExports: true }], - 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }], // allow variables that starts with _ - 'no-restricted-imports': [ - 'warn', - { - name: 'bluebird', - message: 'Please use native promises instead.' - }, - { - name: 'ramda', - message: 'Please use lodash or native javascript instead.' - }, - { - name: 'partial.lenses', - message: 'Please use lodash or native javascript instead.' - }, - { - name: 'moment', - message: 'Please use native Date() and date-fns instead.' + ...(hasMocha && { + 'mocha/no-mocha-arrows': 'off', + 'mocha/no-setup-in-describe': 'off', + 'mocha/no-sibling-hooks': 'off', + 'mocha/no-hooks-for-single-case': 'off', + 'mocha/no-exclusive-tests': ['error'] + }), + ...(hasJest && { + 'jest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }] + }), + ...(hasReact && { + 'react/prop-types': 'off' + }), + ...(hasReactHooks && { + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'warn' + }) +} + +const sharedPlugins = { + import: pluginImport, + promise: pluginPromise, + prettier: pluginPrettier, + ...(hasMocha && { mocha: pluginMocha }), + ...(hasJest && { jest: pluginJest }), + ...(hasReact && { react: pluginReact }), + ...(hasReactHooks && { 'react-hooks': pluginReactHooks }) +} + +export default [ + { + name: 'shared', + plugins: sharedPlugins, + languageOptions: { + ecmaVersion: 2023, + sourceType: 'module', + globals: { + // Minimal globals; environments added via "linterOptions" } - ], - 'import/default': 0, - 'import/named': 0, - 'import/namespace': 0, - 'import/no-unresolved': 0, - 'import/no-commonjs': ['warn'], // We want to use imports instead - 'one-var': ['error', 'never'], - 'prefer-arrow-callback': ['error'], - 'prefer-destructuring': ['error', { array: false }], - 'prefer-template': ['error'], - 'promise/avoid-new': 0, - 'promise/catch-or-return': ['error', { allowFinally: true }], - 'promise/no-callback-in-promise': 0, - 'promise/no-nesting': 0, - 'promise/prefer-await-to-then': ['warn'], - 'require-await': 'error', - ...(hasMocha && { - 'mocha/no-mocha-arrows': 0, - 'mocha/no-setup-in-describe': 0, // This would be nice, but currently it breaks too much existing code. - 'mocha/no-sibling-hooks': 0, - 'mocha/no-hooks-for-single-case': 0, - 'mocha/no-exclusive-tests': ['error'] - }), - ...(hasJest && { - 'jest/expect-expect': ['error', { assertFunctionNames: ['expect*'] }] - }), - ...(hasReact && { - 'react/prop-types': 0 // We don't use prop-types. - }) + }, + linterOptions: { + noInlineConfig: false, + reportUnusedDisableDirectives: true + }, + settings: { + ...(hasReact && { react: { version: 'detect' } }) + }, + rules: sharedRules }, - settings: { - ...(hasReact && { react: { version: 'detect' } }) + + { + name: 'javascript', + files: ['**/*.{js,cjs,mjs}'], + rules: { + 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }] + } }, - overrides: [ - { - files: ['**.ts', '**.tsx'], - extends: ['plugin:@typescript-eslint/recommended-requiring-type-checking'], - parser: '@typescript-eslint/parser', + + { + name: 'typescript', + files: ['**/*.{ts,tsx}'], + languageOptions: { + parser: tsParser, parserOptions: { - project: './tsconfig.json' - }, - plugins: ['@typescript-eslint'], - rules: { - 'no-unused-vars': 0, - '@typescript-eslint/explicit-function-return-type': 0, - '@typescript-eslint/no-explicit-any': 0, // We probably should enable this, but it breaks a lot of code right now (unknown is usually the better choice). - '@typescript-eslint/no-non-null-assertion': 0, // We use these quite extensively when the compiler isn't smart enough. - '@typescript-eslint/no-use-before-define': 0, - '@typescript-eslint/no-var-requires': 0, - '@typescript-eslint/unbound-method': 0, // We like using libraries like lodash or Ramda, where using "methods" this way is the norm. - '@typescript-eslint/no-unused-vars': 0 + project: './tsconfig.json', + tsconfigRootDir: process.cwd(), + ecmaVersion: 2023, + sourceType: 'module' } + }, + plugins: { + ...sharedPlugins, + '@typescript-eslint': tsPlugin + }, + rules: { + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-use-before-define': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/unbound-method': 'off' } - ] -} + } +] diff --git a/packages/examination-utils/package.json b/packages/examination-utils/package.json index 9173ace..d3cddcd 100644 --- a/packages/examination-utils/package.json +++ b/packages/examination-utils/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/express-utils/package.json b/packages/express-utils/package.json index cff5556..b09f5e3 100644 --- a/packages/express-utils/package.json +++ b/packages/express-utils/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 0924cc6..e9becdc 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "dependencies": { diff --git a/packages/json-exam-utils/package.json b/packages/json-exam-utils/package.json index dd6f269..067dddd 100644 --- a/packages/json-exam-utils/package.json +++ b/packages/json-exam-utils/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/logger/package.json b/packages/logger/package.json index b338d2a..d686341 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "devDependencies": { diff --git a/packages/passphrase-generator/package.json b/packages/passphrase-generator/package.json index 7570932..241b4b5 100644 --- a/packages/passphrase-generator/package.json +++ b/packages/passphrase-generator/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/passport-saml-cache-postgres/package.json b/packages/passport-saml-cache-postgres/package.json index e41cba6..64099ba 100644 --- a/packages/passport-saml-cache-postgres/package.json +++ b/packages/passport-saml-cache-postgres/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json && cp ./schema.sql ./dist/.", "test": "node --test --test-concurrency=1 --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/passport-utils/package.json b/packages/passport-utils/package.json index e6f5f5d..06856e0 100644 --- a/packages/passport-utils/package.json +++ b/packages/passport-utils/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --test-concurrency=1 --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/saml-mock/package.json b/packages/saml-mock/package.json index 6eccd1c..9b2a1e0 100644 --- a/packages/saml-mock/package.json +++ b/packages/saml-mock/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json && cp -r ./src/certs ./dist/certs && cp -r ./src/templates ./dist/templates", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/testing/package.json b/packages/testing/package.json index 970939d..7eaaf6e 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/validation/package.json b/packages/validation/package.json index 1f012b0..be15baa 100644 --- a/packages/validation/package.json +++ b/packages/validation/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { diff --git a/packages/zip-utils/package.json b/packages/zip-utils/package.json index 93c7d26..9b11706 100644 --- a/packages/zip-utils/package.json +++ b/packages/zip-utils/package.json @@ -14,7 +14,7 @@ "scripts": { "build": "tsc --project ./tsconfig.build.json", "test": "node --test --import tsx ./__tests__/*.test.ts", - "lint": "tsc --noEmit && eslint --ignore-path ../../.eslintignore ./", + "lint": "tsc --noEmit && eslint ./", "prepare": "npm run build" }, "publishConfig": { From 2cdc3269fadefc499c3e0edd023559c7e15b3efb Mon Sep 17 00:00:00 2001 From: antti-manninen-vmv Date: Mon, 3 Nov 2025 16:24:53 +0200 Subject: [PATCH 2/2] Fix dependency check --- packages/eslint-config/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-config/src/index.js b/packages/eslint-config/src/index.js index dc16d30..6cd9df3 100644 --- a/packages/eslint-config/src/index.js +++ b/packages/eslint-config/src/index.js @@ -5,7 +5,7 @@ function hasDependency(mod) { try { const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) - require.resolve(mod, { paths: [__dirname] }) + import.meta.resolve(mod, `file://${__dirname}/`) return true } catch { return false