From 35d353af0753e4ad3324085e2215b8cbd4e68748 Mon Sep 17 00:00:00 2001 From: Sebastian Rettig Date: Sun, 29 Dec 2024 16:34:50 +0100 Subject: [PATCH] refactor: updated to eslint 9, dropped airbnb preset * refactor: removed unused eslint packages * refactor: updated to eslint 9, dropped airbnb preset * refactor: fixed react demo components --- .eslintignore | 11 - .eslintrc.js | 83 -- eslint.config.mjs | 68 ++ package-lock.json | 787 +++++++----------- package.json | 25 +- packages/h5p-examples/.eslintrc.js | 11 - .../src/client/ContentTypeCacheComponent.tsx | 5 +- .../src/client/LibraryAdminComponent.tsx | 4 +- .../src/client/LibraryDetailsComponent.tsx | 4 +- .../h5p-examples/test/e2e/helpers/upload.ts | 1 - .../h5p-html-exporter/src/HtmlExporter.ts | 1 + .../h5p-html-exporter/src/framedTemplate.ts | 2 +- .../h5p-mongos3/src/MongoLibraryStorage.ts | 5 +- packages/h5p-mongos3/src/initS3.ts | 2 +- .../test/MongoContentUserDataStorage.test.ts | 2 +- packages/h5p-react/src/H5PEditorUI.tsx | 1 + packages/h5p-react/src/H5PPlayerUI.tsx | 1 + packages/h5p-rest-example-client/.eslintrc.js | 13 - packages/h5p-rest-example-client/package.json | 2 +- packages/h5p-rest-example-client/src/App.tsx | 4 +- .../components/ContentListEntryComponent.tsx | 4 +- .../components/LibraryDetailsComponent.tsx | 3 +- .../src/components/Login.tsx | 94 +-- .../h5p-rest-example-client/src/index.tsx | 9 +- .../h5p-rest-example-client/src/setupProxy.js | 1 + packages/h5p-rest-example-server/.eslintrc.js | 12 - packages/h5p-server/src/ContentFileScanner.ts | 3 +- packages/h5p-server/src/ContentScanner.ts | 6 +- packages/h5p-server/src/H5PAjaxEndpoint.ts | 16 +- packages/h5p-server/src/SemanticsEnforcer.ts | 2 +- .../implementation/fs/FileContentStorage.ts | 6 +- .../test/FileContentStorage.test.ts | 1 - .../test/H5PEditor.uploadingPackages.test.ts | 2 +- 33 files changed, 493 insertions(+), 698 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js create mode 100644 eslint.config.mjs delete mode 100644 packages/h5p-examples/.eslintrc.js delete mode 100644 packages/h5p-rest-example-client/.eslintrc.js delete mode 100644 packages/h5p-rest-example-server/.eslintrc.js diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 9fe4a8ff6..000000000 --- a/.eslintignore +++ /dev/null @@ -1,11 +0,0 @@ -build/ -build-ide/ -coverage/ -scripts/ -h5p/ -node_modules/ -packages/h5p-rest-example-client -*.d.ts -.eslintrc.js -.config.js -packages/h5p-html-exporter/src/*.js \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index cfa44677c..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,83 +0,0 @@ -const path = require('path'); - -module.exports = { - env: { - browser: true, - node: true - }, - root: true, - extends: [ - //'eslint:recommended', - //'plugin:@typescript-eslint/recommended', - 'airbnb-typescript', - 'prettier' - ], - parser: '@typescript-eslint/parser', - parserOptions: { - project: path.join(__dirname, 'tsconfig.json'), - sourceType: 'module' - }, - plugins: ['prettier', '@typescript-eslint', 'import', 'react'], - rules: { - 'no-script-url': 0, - 'no-restricted-syntax': 0, - '@typescript-eslint/lines-between-class-members': 0, - 'no-await-in-loop': 1, - '@typescript-eslint/no-loop-func': 0, - 'no-return-assign': 1, - 'import/prefer-default-export': 0, // TODO: change to 1 later - '@typescript-eslint/no-unused-vars': 1, - 'class-methods-use-this': 1, - 'no-param-reassign': 1, - 'no-nested-ternary': 1, - 'no-continue': 0, - 'no-case-declarations': 0, - 'prettier/prettier': 'error', - '@typescript-eslint/typedef': [ - 'error', - { - parameter: true, - propertyDeclaration: true, - memberVariableDeclaration: true, - variableDeclarationIgnoreFunction: true - } - ], - '@typescript-eslint/explicit-module-boundary-types': [ - 'error', - { - allowArgumentsExplicitlyTypedAsAny: true, - allowHigherOrderFunctions: true, - allowTypedFunctionExpressions: true - } - ], - '@typescript-eslint/explicit-function-return-type': [ - 'error', - { - allowExpressions: true - } - ], - '@typescript-eslint/member-ordering': [ - 'error', - { - default: [ - 'public-constructor', - 'private-constructor', - 'public-static-field', - 'private-static-field', - 'public-instance-field', - 'private-instance-field', - 'public-static-method', - 'private-static-method', - 'public-instance-method', - 'private-instance-method' - ] - } - ], - 'class-methods-use-this': 0 - }, - settings: { - react: { - version: '17.0' - } - } -}; diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..fe9370b15 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,68 @@ +import globals from "globals"; +import pluginJs from "@eslint/js"; +import tseslint from "typescript-eslint"; +import pluginReact from "eslint-plugin-react"; +import eslintConfigPrettier from "eslint-config-prettier"; + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + { + files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"], + }, + { + ignores: [ + '**/build/', + '**/build-ide/', + '**/coverage/', + '**/test/data/', + 'scripts/', + 'packages/h5p-examples/h5p/', + 'packages/h5p-rest-example-server/h5p/', + '**/node_modules/', + '**/*.d.ts', + '**/*.config.js', + 'packages/h5p-html-exporter/src/**/*.js',] + }, + { languageOptions: { globals: { ...globals.browser, ...globals.node } } }, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, + pluginReact.configs.flat.recommended, + { + settings: { + react: { + "version": "18" + } + } + }, + eslintConfigPrettier, + { + rules: { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unused-vars": ["warn", + { "argsIgnorePattern": "^_" } + ], + "no-console": "warn", + "no-await-in-loop": "warn", // TODO : make error later + "no-param-reassign": "error", + "react/prop-types": "warn", // TODO : make error later + '@typescript-eslint/member-ordering': [ + 'error', + { + default: [ + 'public-constructor', + 'private-constructor', + 'public-static-field', + 'private-static-field', + 'public-instance-field', + 'private-instance-field', + 'public-static-method', + 'private-static-method', + 'public-instance-method', + 'private-instance-method' + ] + } + ], + + } + } +]; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index de42b672c..02fdcec11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,22 +11,17 @@ "license": "GPL-3.0-or-later", "devDependencies": { "@commitlint/config-conventional": "17.8.1", + "@eslint/js": "^9.17.0", "@types/jest": "29.5.14", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "axios": "1.7.5", "commitlint": "17.8.1", "concurrently": "8.2.2", - "eslint": "8.57.1", - "eslint-config-airbnb": "19.0.4", - "eslint-config-airbnb-typescript": "17.1.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-import": "2.30.0", - "eslint-plugin-jsx-a11y": "6.10.2", - "eslint-plugin-prefer-arrow": "1.2.3", - "eslint-plugin-prettier": "4.2.1", - "eslint-plugin-react": "7.35.0", - "eslint-plugin-react-hooks": "4.6.2", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-react": "^7.35.0", + "globals": "^15.14.0", "husky": "8.0.3", "jest": "29.7.0", "json-autotranslate": "1.14.5", @@ -37,10 +32,11 @@ "ts-jest": "29.2.5", "ts-node": "10.9.2", "typedoc": "0.26.6", - "typescript": "5.5.4" + "typescript": "5.5.4", + "typescript-eslint": "^8.18.2" }, "engines": { - "node": ">=15.0.0", + "node": ">=20.0.0", "npm": ">=7.0.0" } }, @@ -1776,6 +1772,22 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "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/eslintrc/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -1784,13 +1796,13 @@ "license": "MIT" }, "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.17.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.17.0.tgz", + "integrity": "sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==", "dev": true, "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@gar/promisify": { @@ -4398,13 +4410,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/@rtsao/scc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", - "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true, - "license": "MIT" - }, "node_modules/@shikijs/core": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.14.1.tgz", @@ -5443,13 +5448,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/long": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", @@ -6102,16 +6100,6 @@ "dev": true, "license": "Python-2.0" }, - "node_modules/aria-query": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", - "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/array-buffer-byte-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", @@ -6198,27 +6186,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array.prototype.findlastindex": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", - "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array.prototype.flat": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", @@ -6307,13 +6274,6 @@ "node": ">=8" } }, - "node_modules/ast-types-flow": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", - "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", - "dev": true, - "license": "MIT" - }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -6354,16 +6314,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/axe-core": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.0.tgz", - "integrity": "sha512-Mr2ZakwQ7XUAjp7pAwQWRhhK8mQQ6JAaNWSjmjxil0R8BPioMtQsTLOolGYkji1rcL++3dCqZA3zWqpT+9Ew6g==", - "dev": true, - "license": "MPL-2.0", - "engines": { - "node": ">=4" - } - }, "node_modules/axios": { "version": "1.7.5", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.5.tgz", @@ -6376,16 +6326,6 @@ "proxy-from-env": "^1.1.0" } }, - "node_modules/axobject-query": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", - "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/babel-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", @@ -7397,13 +7337,6 @@ "proto-list": "~1.2.1" } }, - "node_modules/confusing-browser-globals": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", - "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", - "dev": true, - "license": "MIT" - }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", @@ -7778,13 +7711,6 @@ "node": ">=4" } }, - "node_modules/damerau-levenshtein": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", - "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", - "dev": true, - "license": "BSD-2-Clause" - }, "node_modules/dargs": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", @@ -8616,74 +8542,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-config-airbnb": { - "version": "19.0.4", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-19.0.4.tgz", - "integrity": "sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew==", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-config-airbnb-base": "^15.0.0", - "object.assign": "^4.1.2", - "object.entries": "^1.1.5" - }, - "engines": { - "node": "^10.12.0 || ^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^7.32.0 || ^8.2.0", - "eslint-plugin-import": "^2.25.3", - "eslint-plugin-jsx-a11y": "^6.5.1", - "eslint-plugin-react": "^7.28.0", - "eslint-plugin-react-hooks": "^4.3.0" - } - }, - "node_modules/eslint-config-airbnb-base": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", - "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", - "dev": true, - "license": "MIT", - "dependencies": { - "confusing-browser-globals": "^1.0.10", - "object.assign": "^4.1.2", - "object.entries": "^1.1.5", - "semver": "^6.3.0" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - }, - "peerDependencies": { - "eslint": "^7.32.0 || ^8.2.0", - "eslint-plugin-import": "^2.25.2" - } - }, - "node_modules/eslint-config-airbnb-base/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/eslint-config-airbnb-typescript": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.1.0.tgz", - "integrity": "sha512-GPxI5URre6dDpJ0CtcthSZVBAfI+Uw7un5OYNVxP2EYi3H81Jw701yFP7AU+/vCE7xBtFmjge7kfhhk4+RAiig==", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-config-airbnb-base": "^15.0.0" - }, - "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^5.13.0 || ^6.0.0", - "@typescript-eslint/parser": "^5.0.0 || ^6.0.0", - "eslint": "^7.32.0 || ^8.2.0", - "eslint-plugin-import": "^2.25.3" - } - }, "node_modules/eslint-config-prettier": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", @@ -8697,184 +8555,6 @@ "eslint": ">=7.0.0" } }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", - "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^3.2.7", - "is-core-module": "^2.13.0", - "resolve": "^1.22.4" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-module-utils": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.9.0.tgz", - "integrity": "sha512-McVbYmwA3NEKwRQY5g4aWMdcZE5xZxV8i8l7CqJSrameuGSQJtSWaL/LxTEzSKKaCcOhlpDR8XEfYXWPrdo/ZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^3.2.7" - }, - "engines": { - "node": ">=4" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } - } - }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.30.0.tgz", - "integrity": "sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rtsao/scc": "^1.1.0", - "array-includes": "^3.1.8", - "array.prototype.findlastindex": "^1.2.5", - "array.prototype.flat": "^1.3.2", - "array.prototype.flatmap": "^1.3.2", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.9.0", - "hasown": "^2.0.2", - "is-core-module": "^2.15.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "object.groupby": "^1.0.3", - "object.values": "^1.2.0", - "semver": "^6.3.1", - "tsconfig-paths": "^3.15.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" - } - }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/eslint-plugin-jsx-a11y": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.2.tgz", - "integrity": "sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "aria-query": "^5.3.2", - "array-includes": "^3.1.8", - "array.prototype.flatmap": "^1.3.2", - "ast-types-flow": "^0.0.8", - "axe-core": "^4.10.0", - "axobject-query": "^4.1.0", - "damerau-levenshtein": "^1.0.8", - "emoji-regex": "^9.2.2", - "hasown": "^2.0.2", - "jsx-ast-utils": "^3.3.5", - "language-tags": "^1.0.9", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "safe-regex-test": "^1.0.3", - "string.prototype.includes": "^2.0.1" - }, - "engines": { - "node": ">=4.0" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" - } - }, - "node_modules/eslint-plugin-prefer-arrow": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz", - "integrity": "sha512-J9I5PKCOJretVuiZRGvPQxCbllxGAV/viI20JO3LYblAodofBxyMnZAJ+WGeClHgANnSJberTNoFWWjrWKBuXQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "eslint": ">=2.0.0" - } - }, - "node_modules/eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "prettier-linter-helpers": "^1.0.0" - }, - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "eslint": ">=7.28.0", - "prettier": ">=2.0.0" - }, - "peerDependenciesMeta": { - "eslint-config-prettier": { - "optional": true - } - } - }, "node_modules/eslint-plugin-react": { "version": "7.35.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.35.0.tgz", @@ -8908,19 +8588,6 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" } }, - "node_modules/eslint-plugin-react-hooks": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", - "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" - } - }, "node_modules/eslint-plugin-react/node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -8999,6 +8666,16 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/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==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/eslint/node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -9033,6 +8710,22 @@ "url": "https://opencollective.com/eslint" } }, + "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/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -9221,13 +8914,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-diff": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", - "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -10087,16 +9773,13 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "15.14.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.14.0.tgz", + "integrity": "sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==", "dev": true, "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -12442,26 +12125,6 @@ "node": ">=6" } }, - "node_modules/language-subtag-registry": { - "version": "0.3.23", - "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", - "integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==", - "dev": true, - "license": "CC0-1.0" - }, - "node_modules/language-tags": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", - "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", - "dev": true, - "license": "MIT", - "dependencies": { - "language-subtag-registry": "^0.3.20" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/lerna": { "version": "6.6.2", "resolved": "https://registry.npmjs.org/lerna/-/lerna-6.6.2.tgz", @@ -15831,21 +15494,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object.groupby": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", - "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/object.values": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", @@ -16653,19 +16301,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-diff": "^1.1.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -18352,21 +17987,6 @@ "dev": true, "license": "MIT" }, - "node_modules/string.prototype.includes": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz", - "integrity": "sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.3" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/string.prototype.matchall": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", @@ -18908,6 +18528,19 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/ts-api-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-jest": { "version": "29.2.5", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", @@ -19011,42 +18644,6 @@ } } }, - "node_modules/tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/tsconfig-paths/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/tslib": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", @@ -19400,6 +18997,248 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.2.tgz", + "integrity": "sha512-KuXezG6jHkvC3MvizeXgupZzaG5wjhU3yE8E7e6viOvAvD9xAWYp8/vy0WULTGe9DYDWcQu7aW03YIV3mSitrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.18.2", + "@typescript-eslint/parser": "8.18.2", + "@typescript-eslint/utils": "8.18.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.2.tgz", + "integrity": "sha512-adig4SzPLjeQ0Tm+jvsozSGiCliI2ajeURDGHjZ2llnA+A67HihCQ+a3amtPhUakd1GlwHxSRvzOZktbEvhPPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.18.2", + "@typescript-eslint/type-utils": "8.18.2", + "@typescript-eslint/utils": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.2.tgz", + "integrity": "sha512-y7tcq4StgxQD4mDr9+Jb26dZ+HTZ/SkfqpXSiqeUXZHxOUyjWDKsmwKhJ0/tApR08DgOhrFAoAhyB80/p3ViuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.18.2", + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/typescript-estree": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.2.tgz", + "integrity": "sha512-YJFSfbd0CJjy14r/EvWapYgV4R5CHzptssoag2M7y3Ra7XNta6GPAJPPP5KGB9j14viYXyrzRO5GkX7CRfo8/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/type-utils": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.2.tgz", + "integrity": "sha512-AB/Wr1Lz31bzHfGm/jgbFR0VB0SML/hd2P1yxzKDM48YmP7vbyJNHRExUE/wZsQj2wUCvbWH8poNHFuxLqCTnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.18.2", + "@typescript-eslint/utils": "8.18.2", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.2.tgz", + "integrity": "sha512-Z/zblEPp8cIvmEn6+tPDIHUbRu/0z5lqZ+NvolL5SvXWT5rQy7+Nch83M0++XzO0XrWRFWECgOAyE8bsJTl1GQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.2.tgz", + "integrity": "sha512-WXAVt595HjpmlfH4crSdM/1bcsqh+1weFRWIa9XMTx/XHZ9TCKMcr725tLYqWOgzKdeDrqVHxFotrvWcEsk2Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/visitor-keys": "8.18.2", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/utils": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.2.tgz", + "integrity": "sha512-Cr4A0H7DtVIPkauj4sTSXVl+VBWewE9/o40KcF3TV9aqDEOWoXF3/+oRXNby3DYzZeCATvbdksYsGZzplwnK/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.18.2", + "@typescript-eslint/types": "8.18.2", + "@typescript-eslint/typescript-estree": "8.18.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.2.tgz", + "integrity": "sha512-zORcwn4C3trOWiCqFQP1x6G3xTRyZ1LYydnj51cRnJ6hxBlr/cKPckk+PKPUw/fXmvfKTcw7bwY3w9izgx5jZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.18.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typescript-eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/typescript-eslint/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/uc.micro": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", diff --git a/package.json b/package.json index 5a2725e5b..ff9e48eb5 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,8 @@ "format:check": "npx prettier --check \"packages/*/{src,test,examples}/**/*.{ts,tsx}\"", "format": "npx prettier --write \"packages/*/{src,test,examples}/**/*.{ts,tsx}\"", "lint:docs": "remark -u validate-links ./docs --frail --quiet", - "lint:main": "eslint -c .eslintrc.js --ext .ts packages --quiet", - "lint:rest-client": "npm run lint --prefix packages/h5p-rest-example-client", - "lint": "concurrently \"npm:lint:main\" \"npm:lint:rest-client\" \"npm:lint:docs\"", + "lint:main": "eslint . --quiet", + "lint": "concurrently \"npm:lint:main\" \"npm:lint:docs\"", "localize": "./localize.sh", "postinstall": "npx lerna bootstrap && concurrently \"npm run build\" \"npm run download:content-type-cache && npm run download:h5p\"", "pre-commit": "concurrently \"npm:lint\" \"npm:format\"", @@ -88,22 +87,17 @@ ], "devDependencies": { "@commitlint/config-conventional": "17.8.1", + "@eslint/js": "^9.17.0", "@types/jest": "29.5.14", "@typescript-eslint/eslint-plugin": "5.62.0", "@typescript-eslint/parser": "5.62.0", "axios": "1.7.5", "commitlint": "17.8.1", "concurrently": "8.2.2", - "eslint": "8.57.1", - "eslint-config-airbnb": "19.0.4", - "eslint-config-airbnb-typescript": "17.1.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-import": "2.30.0", - "eslint-plugin-jsx-a11y": "6.10.2", - "eslint-plugin-prefer-arrow": "1.2.3", - "eslint-plugin-prettier": "4.2.1", - "eslint-plugin-react": "7.35.0", - "eslint-plugin-react-hooks": "4.6.2", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-react": "^7.35.0", + "globals": "^15.14.0", "husky": "8.0.3", "jest": "29.7.0", "json-autotranslate": "1.14.5", @@ -114,10 +108,11 @@ "ts-jest": "29.2.5", "ts-node": "10.9.2", "typedoc": "0.26.6", - "typescript": "5.5.4" + "typescript": "5.5.4", + "typescript-eslint": "^8.18.2" }, "engines": { - "node": ">=15.0.0", + "node": ">=20.0.0", "npm": ">=7.0.0" } } diff --git a/packages/h5p-examples/.eslintrc.js b/packages/h5p-examples/.eslintrc.js deleted file mode 100644 index 3e06cad00..000000000 --- a/packages/h5p-examples/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc.js'], - parserOptions: { - project: ['tsconfig.client.json', 'tsconfig.server.json'], - sourceType: 'module', - tsconfigRootDir: __dirname - }, - rules: { - 'no-console': 0 - } -}; diff --git a/packages/h5p-examples/src/client/ContentTypeCacheComponent.tsx b/packages/h5p-examples/src/client/ContentTypeCacheComponent.tsx index 980a6020f..6a263dd07 100644 --- a/packages/h5p-examples/src/client/ContentTypeCacheComponent.tsx +++ b/packages/h5p-examples/src/client/ContentTypeCacheComponent.tsx @@ -9,14 +9,15 @@ import ContentTypeCacheService from './ContentTypeCacheService.js'; * It uses Bootstrap 4 to layout the component. You can override or replace the * render() method to customize looks. */ -export default class ContentTypeCacheComponent extends React.Component { +export default class ContentTypeCacheComponent extends React.Component<{ + endpointUrl: string; +}> { /** * @param endpointurl the URL of the REST content type cache administration * endpoint */ constructor(props: { endpointUrl: string }) { super(props); - this.state = { lastCacheUpdate: undefined, updatingCache: null diff --git a/packages/h5p-examples/src/client/LibraryAdminComponent.tsx b/packages/h5p-examples/src/client/LibraryAdminComponent.tsx index 6bc107a4e..ddf73d25d 100644 --- a/packages/h5p-examples/src/client/LibraryAdminComponent.tsx +++ b/packages/h5p-examples/src/client/LibraryAdminComponent.tsx @@ -19,7 +19,9 @@ import { * It uses Bootstrap 4 to layout the component. You can override or replace the * render() method to customize looks. */ -export default class LibraryAdmin extends React.Component { +export default class LibraryAdmin extends React.Component<{ + endpointUrl: string; +}> { /** * @param endpointUrl the URL of the REST library administration endpoint. */ diff --git a/packages/h5p-examples/src/client/LibraryDetailsComponent.tsx b/packages/h5p-examples/src/client/LibraryDetailsComponent.tsx index 82e73b73a..b26c45821 100644 --- a/packages/h5p-examples/src/client/LibraryDetailsComponent.tsx +++ b/packages/h5p-examples/src/client/LibraryDetailsComponent.tsx @@ -7,7 +7,7 @@ const yesNo = (value: boolean | 0 | 1) => ) : ( ); -export default (props: { +const LibraryDetailsComponent = (props: { details: IInstalledLibrary & { dependentsCount: number; instancesAsDependencyCount: number; @@ -106,3 +106,5 @@ export default (props: { )} ); + +export default LibraryDetailsComponent; diff --git a/packages/h5p-examples/test/e2e/helpers/upload.ts b/packages/h5p-examples/test/e2e/helpers/upload.ts index 7eda5b960..a90b92367 100644 --- a/packages/h5p-examples/test/e2e/helpers/upload.ts +++ b/packages/h5p-examples/test/e2e/helpers/upload.ts @@ -1,4 +1,3 @@ -//eslint-disable-next-line import/no-extraneous-dependencies import puppeteer, { ElementHandle } from 'puppeteer'; // On 4th Oct 2020, the Puppeteer types didn't include waitForTimeout, so we diff --git a/packages/h5p-html-exporter/src/HtmlExporter.ts b/packages/h5p-html-exporter/src/HtmlExporter.ts index 3563354dd..35f378722 100644 --- a/packages/h5p-html-exporter/src/HtmlExporter.ts +++ b/packages/h5p-html-exporter/src/HtmlExporter.ts @@ -748,6 +748,7 @@ export default class HtmlExporter { } const usedFiles = new LibrariesFilesList(); + // eslint-disable-next-line prefer-const let [scriptsBundle, stylesBundle] = await Promise.all([ this.getScriptBundle( model, diff --git a/packages/h5p-html-exporter/src/framedTemplate.ts b/packages/h5p-html-exporter/src/framedTemplate.ts index 5a3c7a4a9..fb5b1b040 100644 --- a/packages/h5p-html-exporter/src/framedTemplate.ts +++ b/packages/h5p-html-exporter/src/framedTemplate.ts @@ -22,7 +22,7 @@ export default ( if (new URLSearchParams(window.location.search).get('embed') == 'true') { H5PIntegration.contents['cid-' + '${contentId}'].displayOptions.embed = false; } else { - H5PIntegration.contents['cid-' + '${contentId}'].embedCode = ''; + H5PIntegration.contents['cid-' + '${contentId}'].embedCode = ''; H5PIntegration.contents['cid-' + '${contentId}'].resizeCode = ''; } diff --git a/packages/h5p-mongos3/src/MongoLibraryStorage.ts b/packages/h5p-mongos3/src/MongoLibraryStorage.ts index cee92a79a..fb0184584 100644 --- a/packages/h5p-mongos3/src/MongoLibraryStorage.ts +++ b/packages/h5p-mongos3/src/MongoLibraryStorage.ts @@ -30,7 +30,10 @@ export default class MongoLibraryStorage implements ILibraryStorage { * @param mongodb a MongoDB collection (read- and writable) * @param options options */ - constructor(private mongodb: MongoDB.Collection, private options?: {}) { + constructor( + private mongodb: MongoDB.Collection, + private options?: unknown + ) { log.info('initialize'); } diff --git a/packages/h5p-mongos3/src/initS3.ts b/packages/h5p-mongos3/src/initS3.ts index 75f87348a..49c7537a3 100644 --- a/packages/h5p-mongos3/src/initS3.ts +++ b/packages/h5p-mongos3/src/initS3.ts @@ -11,7 +11,7 @@ import AWS from 'aws-sdk'; * @returns the S3 client */ export default (options?: AWS.S3.ClientConfiguration): AWS.S3 => { - const optionsWithOverrides = { ...options } ?? {}; + const optionsWithOverrides = options ? { ...options } : {}; // add overrides to configuration values that are set through environment // variables diff --git a/packages/h5p-mongos3/test/MongoContentUserDataStorage.test.ts b/packages/h5p-mongos3/test/MongoContentUserDataStorage.test.ts index fe0d6e418..6eb29ec91 100644 --- a/packages/h5p-mongos3/test/MongoContentUserDataStorage.test.ts +++ b/packages/h5p-mongos3/test/MongoContentUserDataStorage.test.ts @@ -14,7 +14,7 @@ describe('MongoContentUserDataStorage', () => { let testId: string; let counter = 0; let storage: MongoContentUserDataStorage; - let getStorage = (): IContentUserDataStorage => storage; + const getStorage = (): IContentUserDataStorage => storage; beforeAll(async () => { testId = new ObjectId().toHexString(); diff --git a/packages/h5p-react/src/H5PEditorUI.tsx b/packages/h5p-react/src/H5PEditorUI.tsx index 83bde3ee0..ed3a2c911 100644 --- a/packages/h5p-react/src/H5PEditorUI.tsx +++ b/packages/h5p-react/src/H5PEditorUI.tsx @@ -13,6 +13,7 @@ declare global { /** * Enables type checks for JSX. */ + // eslint-disable-next-line @typescript-eslint/no-namespace namespace JSX { interface IntrinsicElements { 'h5p-editor': { diff --git a/packages/h5p-react/src/H5PPlayerUI.tsx b/packages/h5p-react/src/H5PPlayerUI.tsx index 6d6e5a625..fb678cc0f 100644 --- a/packages/h5p-react/src/H5PPlayerUI.tsx +++ b/packages/h5p-react/src/H5PPlayerUI.tsx @@ -14,6 +14,7 @@ import type { IPlayerModel } from '@lumieducation/h5p-server'; defineElements('h5p-player'); declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace namespace JSX { interface IntrinsicElements { 'h5p-player': { diff --git a/packages/h5p-rest-example-client/.eslintrc.js b/packages/h5p-rest-example-client/.eslintrc.js deleted file mode 100644 index 1ba141698..000000000 --- a/packages/h5p-rest-example-client/.eslintrc.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - env: { - browser: true - }, - root: true, - extends: ['react-app', 'prettier'], - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.build.json', - sourceType: 'module' - }, - plugins: ['prettier', '@typescript-eslint'] -}; diff --git a/packages/h5p-rest-example-client/package.json b/packages/h5p-rest-example-client/package.json index 1b6e230ff..ced797681 100644 --- a/packages/h5p-rest-example-client/package.json +++ b/packages/h5p-rest-example-client/package.json @@ -30,7 +30,7 @@ "eject": "react-scripts eject", "start": "react-scripts start", "test": "react-scripts test", - "lint": "npx eslint -c .eslintrc.js --ext .ts src --quiet" + "lint": "npx eslint . --quiet" }, "browserslist": { "production": [ diff --git a/packages/h5p-rest-example-client/src/App.tsx b/packages/h5p-rest-example-client/src/App.tsx index 988cc6060..1c0b8891f 100644 --- a/packages/h5p-rest-example-client/src/App.tsx +++ b/packages/h5p-rest-example-client/src/App.tsx @@ -15,14 +15,14 @@ export default class App extends React.Component { this.contentService = new ContentService('/h5p'); } - private contentService: ContentService; - public state: { loggedIn: boolean; } = { loggedIn: false }; + private contentService: ContentService; + render() { return (
diff --git a/packages/h5p-rest-example-client/src/components/ContentListEntryComponent.tsx b/packages/h5p-rest-example-client/src/components/ContentListEntryComponent.tsx index 09846bfac..57a6cc210 100644 --- a/packages/h5p-rest-example-client/src/components/ContentListEntryComponent.tsx +++ b/packages/h5p-rest-example-client/src/components/ContentListEntryComponent.tsx @@ -523,8 +523,8 @@ export default class ContentListEntryComponent extends React.Component<{ You switch whose user state you want to display here. The example permission system only allows - displaying others' user states to teachers and - administrators. + displaying others' user states to teachers + and administrators.
diff --git a/packages/h5p-rest-example-client/src/components/LibraryDetailsComponent.tsx b/packages/h5p-rest-example-client/src/components/LibraryDetailsComponent.tsx index e5cde7f4c..ac168ed09 100644 --- a/packages/h5p-rest-example-client/src/components/LibraryDetailsComponent.tsx +++ b/packages/h5p-rest-example-client/src/components/LibraryDetailsComponent.tsx @@ -9,7 +9,7 @@ const yesNo = (value: undefined | boolean | 0 | 1) => ); -export default (props: { +const LibraryDetailsComponent = (props: { details?: IInstalledLibrary & { dependentsCount: number; instancesAsDependencyCount: number; @@ -108,3 +108,4 @@ export default (props: { )} ); +export default LibraryDetailsComponent; diff --git a/packages/h5p-rest-example-client/src/components/Login.tsx b/packages/h5p-rest-example-client/src/components/Login.tsx index b9efefb78..a2914dc59 100644 --- a/packages/h5p-rest-example-client/src/components/Login.tsx +++ b/packages/h5p-rest-example-client/src/components/Login.tsx @@ -25,53 +25,6 @@ export default class Login extends React.Component< this.state = {}; } - private login = (username) => { - fetch('/login', { - method: 'POST', - headers: { - Accept: 'application/json, text/plain, */*', - 'Content-type': 'application/json' - }, - body: JSON.stringify({ - username: username, - password: username - }) - }) - .then(async (res) => { - if (res.status === 200) { - const loginData = await res.json(); - this.setState({ - ...this.state, - loginData, - loginMessage: undefined - }); - if (loginData.csrfToken) { - this.props.contentService.setCsrfToken( - loginData.csrfToken - ); - } - this.props.onLoggedIn(); - } else { - this.setState({ - ...this.state, - loginData: undefined, - loginMessage: await res.text() - }); - this.props.contentService.setCsrfToken(undefined); - this.props.onLoggedOut(); - } - }) - .catch((reason) => { - this.setState({ - ...this.state, - loginData: undefined, - loginMessage: reason - }); - this.props.contentService.setCsrfToken(undefined); - this.props.onLoggedOut(); - }); - }; - logout = () => { fetch('/logout', { method: 'POST', @@ -150,4 +103,51 @@ export default class Login extends React.Component< ); } + + private login = (username) => { + fetch('/login', { + method: 'POST', + headers: { + Accept: 'application/json, text/plain, */*', + 'Content-type': 'application/json' + }, + body: JSON.stringify({ + username: username, + password: username + }) + }) + .then(async (res) => { + if (res.status === 200) { + const loginData = await res.json(); + this.setState({ + ...this.state, + loginData, + loginMessage: undefined + }); + if (loginData.csrfToken) { + this.props.contentService.setCsrfToken( + loginData.csrfToken + ); + } + this.props.onLoggedIn(); + } else { + this.setState({ + ...this.state, + loginData: undefined, + loginMessage: await res.text() + }); + this.props.contentService.setCsrfToken(undefined); + this.props.onLoggedOut(); + } + }) + .catch((reason) => { + this.setState({ + ...this.state, + loginData: undefined, + loginMessage: reason + }); + this.props.contentService.setCsrfToken(undefined); + this.props.onLoggedOut(); + }); + }; } diff --git a/packages/h5p-rest-example-client/src/index.tsx b/packages/h5p-rest-example-client/src/index.tsx index 9ac046fcc..ecd4c2bd3 100644 --- a/packages/h5p-rest-example-client/src/index.tsx +++ b/packages/h5p-rest-example-client/src/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import ReactDOM from 'react-dom'; +import { createRoot } from 'react-dom/client'; import 'bootstrap/dist/css/bootstrap.min.css'; @@ -7,11 +7,12 @@ import './index.css'; import App from './App'; import * as serviceWorker from './serviceWorker'; -ReactDOM.render( +const container = document.getElementById('root'); +const root = createRoot(container!); +root.render( - , - document.getElementById('root') + ); // If you want your app to work offline and load faster, you can change diff --git a/packages/h5p-rest-example-client/src/setupProxy.js b/packages/h5p-rest-example-client/src/setupProxy.js index d2036541e..5bb0490f6 100644 --- a/packages/h5p-rest-example-client/src/setupProxy.js +++ b/packages/h5p-rest-example-client/src/setupProxy.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line @typescript-eslint/no-require-imports const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { diff --git a/packages/h5p-rest-example-server/.eslintrc.js b/packages/h5p-rest-example-server/.eslintrc.js deleted file mode 100644 index 8b51f2e93..000000000 --- a/packages/h5p-rest-example-server/.eslintrc.js +++ /dev/null @@ -1,12 +0,0 @@ -const path = require('path'); - -module.exports = { - extends: ['../../.eslintrc.js'], - parserOptions: { - project: path.join(__dirname, 'tsconfig.build.json'), - sourceType: 'module' - }, - rules: { - 'no-console': 0 - } -}; diff --git a/packages/h5p-server/src/ContentFileScanner.ts b/packages/h5p-server/src/ContentFileScanner.ts index 00b1e6a09..c9a66b80d 100644 --- a/packages/h5p-server/src/ContentFileScanner.ts +++ b/packages/h5p-server/src/ContentFileScanner.ts @@ -84,7 +84,7 @@ export class ContentFileScanner extends ContentScanner { ); switch (semantics.type) { case 'file': - case 'image': + case 'image': { log.debug(`found ${semantics.type} element`); const element = this.pushIfDefined( results, @@ -111,6 +111,7 @@ export class ContentFileScanner extends ContentScanner { } } return true; // returning true aborts further recursion + } case 'video': case 'audio': if (Array.isArray(params)) { diff --git a/packages/h5p-server/src/ContentScanner.ts b/packages/h5p-server/src/ContentScanner.ts index 94b9f7966..fe24cc71b 100644 --- a/packages/h5p-server/src/ContentScanner.ts +++ b/packages/h5p-server/src/ContentScanner.ts @@ -156,7 +156,7 @@ export class ContentScanner { } switch (elementSemantics.type) { - case 'library': + case 'library': { // If an element contains another library, we have to retrieve // the exact name, and the nested content parameters. if (elementParams.library === undefined) { @@ -180,6 +180,7 @@ export class ContentScanner { { doNotAddNameToJsonPath: false } ); break; + } case 'group': // groups contain several semantic entries, each with their own // parameters. @@ -194,7 +195,7 @@ export class ContentScanner { ); } break; - case 'list': + case 'list': { // lists contain one semantic entry, but several content // elements let counter = 0; @@ -214,6 +215,7 @@ export class ContentScanner { counter += 1; } break; + } default: break; } diff --git a/packages/h5p-server/src/H5PAjaxEndpoint.ts b/packages/h5p-server/src/H5PAjaxEndpoint.ts index a2ef21a9b..af0f12b28 100644 --- a/packages/h5p-server/src/H5PAjaxEndpoint.ts +++ b/packages/h5p-server/src/H5PAjaxEndpoint.ts @@ -544,7 +544,7 @@ export default class H5PAjaxEndpoint { language ) ); - case 'files': + case 'files': { if (!('field' in body)) { throw new H5pError( 'malformed-request', @@ -574,7 +574,8 @@ export default class H5PAjaxEndpoint { filesFile, user ); - case 'filter': + } + case 'filter': { if (!('libraryParameters' in body)) { throw new H5pError( 'malformed-request', @@ -631,7 +632,8 @@ export default class H5PAjaxEndpoint { metadata: unfiltered.metadata, params: filteredParams }); - case 'library-install': + } + case 'library-install': { if (!id || !user) { throw new H5pError( 'malformed-request', @@ -663,8 +665,8 @@ export default class H5PAjaxEndpoint { ) : undefined ); - - case 'library-upload': + } + case 'library-upload': { if (!libraryUploadFile.name.endsWith('.h5p')) { throw new H5pError('missing-h5p-extension', {}, 400); } @@ -700,7 +702,8 @@ export default class H5PAjaxEndpoint { ) : undefined ); - case 'get-content': + } + case 'get-content': { const { installedLibraries: installedLibraries2, metadata: metadata2, @@ -730,6 +733,7 @@ export default class H5PAjaxEndpoint { ) : undefined ); + } default: throw new H5pError( 'malformed-request', diff --git a/packages/h5p-server/src/SemanticsEnforcer.ts b/packages/h5p-server/src/SemanticsEnforcer.ts index 8c810f930..5ba17dac8 100644 --- a/packages/h5p-server/src/SemanticsEnforcer.ts +++ b/packages/h5p-server/src/SemanticsEnforcer.ts @@ -204,7 +204,7 @@ export default class SemanticsEnforcer { allowedStyles['font-size'] = [/^[0-9.]+(em|px|%)$/i]; } if (semantics.font.family) { - allowedStyles['font-family'] = [/^[-a-z0-9,\'&; ]+$/i]; + allowedStyles['font-family'] = [/^[-a-z0-9,'&; ]+$/i]; } if (semantics.font.color) { // eslint-disable-next-line @typescript-eslint/dot-notation diff --git a/packages/h5p-server/src/implementation/fs/FileContentStorage.ts b/packages/h5p-server/src/implementation/fs/FileContentStorage.ts index 76ba5a73c..62b5bd1bc 100644 --- a/packages/h5p-server/src/implementation/fs/FileContentStorage.ts +++ b/packages/h5p-server/src/implementation/fs/FileContentStorage.ts @@ -123,6 +123,7 @@ export default class FileContentStorage implements IContentStorage { id?: ContentId ): Promise { if (id === undefined || id === null) { + // eslint-disable-next-line no-param-reassign id = await this.createContentId(); } try { @@ -142,7 +143,10 @@ export default class FileContentStorage implements IContentStorage { path.join(this.getContentPath(), id.toString()) ); throw new H5pError( - 'storage-file-implementations:error-creating-content' + 'storage-file-implementations:error-creating-content', + {}, + 500, + error.message ); } return id; diff --git a/packages/h5p-server/test/FileContentStorage.test.ts b/packages/h5p-server/test/FileContentStorage.test.ts index 9caf477d0..dc1b5c149 100644 --- a/packages/h5p-server/test/FileContentStorage.test.ts +++ b/packages/h5p-server/test/FileContentStorage.test.ts @@ -50,7 +50,6 @@ describe('FileContentStorage (repository that saves content objects to a local d await withDir( async ({ path: tempDirPath }) => { const storage = new FileContentStorage(tempDirPath); - const filename = 'test.png'; const user = new User(); const id = await storage.addContent( diff --git a/packages/h5p-server/test/H5PEditor.uploadingPackages.test.ts b/packages/h5p-server/test/H5PEditor.uploadingPackages.test.ts index f3df526ae..dee576b8f 100644 --- a/packages/h5p-server/test/H5PEditor.uploadingPackages.test.ts +++ b/packages/h5p-server/test/H5PEditor.uploadingPackages.test.ts @@ -96,7 +96,7 @@ describe('H5PEditor', () => { for (let x = 0; x < 10; x++) { // Upload h5p - let fileBuffer = await fsExtra.readFile(currentFilename); + const fileBuffer = await fsExtra.readFile(currentFilename); const { metadata, parameters } = await h5pEditor.uploadPackage(fileBuffer, user);