From 0ffa890b8960c037c9cbc8c6e4b7d3725fdc755b Mon Sep 17 00:00:00 2001 From: Harel M Date: Mon, 21 Oct 2024 17:07:28 +0300 Subject: [PATCH] Upgrade eslint to version 9 (#4869) * Clean up console log in unit tests * Upgrade eslint to latest version * Fix geocode changes * Revet unwanted changes * Revert change * Fix weird build test * Improve test to actually check something... --- .eslintrc.json | 107 ---- build/generate-doc-images.ts | 2 +- build/generate-struct-arrays.ts | 2 +- build/rollup_plugins.ts | 1 - eslint.config.js | 157 ++++++ package-lock.json | 521 +++++++++++--------- package.json | 13 +- src/geo/lng_lat.test.ts | 2 - src/gl/context.ts | 1 - src/render/terrain.test.ts | 1 - src/source/geojson_source.test.ts | 2 +- src/source/geojson_worker_source.ts | 2 +- src/source/raster_dem_tile_source.ts | 4 +- src/source/tile_id.test.ts | 4 - src/util/geolocation_support.ts | 4 +- src/util/image_request.test.ts | 1 - src/util/script_detection.ts | 4 +- src/util/test/util.ts | 1 - src/util/util.ts | 4 +- src/util/web_worker_transfer.ts | 2 +- src/util/webp_supported.ts | 2 +- test/bench/.eslintrc.json | 17 - test/bench/gl-stats.html | 2 +- test/bench/versions/index.html | 4 +- test/build/min.test.ts | 1 + test/examples/.eslintrc.json | 10 - test/examples/filter-within-layer.html | 6 +- test/examples/geocoder.html | 1 - test/integration/browser/fixtures/land.html | 1 - test/integration/query/query.test.ts | 8 +- test/integration/render/run_render_tests.ts | 7 +- test/unit/lib/simulate_interaction.ts | 12 +- 32 files changed, 479 insertions(+), 427 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js delete mode 100644 test/bench/.eslintrc.json delete mode 100644 test/examples/.eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 266858085f..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "root": true, - "extends": [ - "mourner", - "plugin:import/recommended", - "plugin:import/typescript" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "sourceType": "module", - "createDefaultProgram": true - }, - "plugins": [ - "@typescript-eslint", - "import", - "eslint-plugin-tsdoc", - "jest" - ], - "rules": { - "no-dupe-class-members": "off", - "@typescript-eslint/no-dupe-class-members": ["error"], - "@typescript-eslint/no-unused-vars": [ - "warn", - { "argsIgnorePattern": "^_" } - ], - "@typescript-eslint/member-delimiter-style": ["error"], - "no-useless-constructor": "off", - "@typescript-eslint/no-useless-constructor": ["error"], - // Disable no-undef. It's covered by @typescript-eslint - "no-undef": "off", - // temporarily disabled due to https://github.com/babel/babel-eslint/issues/485 - "no-use-before-define": "off", - - // no-duplicate-imports doesn't play well with Flow - // https://github.com/babel/eslint-plugin-babel/issues/59 - "no-duplicate-imports": "off", - "import/no-duplicates": "error", - - // temporarily disabled for easier upgrading of dependencies - "implicit-arrow-linebreak": "off", - "arrow-parens": "off", - "arrow-body-style": "off", - "no-confusing-arrow": "off", - "no-control-regex": "off", - "no-invalid-this": "off", - "no-buffer-constructor": "off", - - "array-bracket-spacing": "error", - "consistent-return": "off", - "global-require": "off", - "import/no-commonjs": "error", - // TSC throws an error on unresolved imports; eslint doesn't understand .js extension in import statement - "import/no-unresolved": "off", - "key-spacing": "error", - "no-eq-null": "off", - "no-lonely-if": "off", - "no-new": "off", - "no-restricted-properties": [2, { - "object": "Object", - "property": "assign" - }], - "no-unused-vars": "off", - "no-warning-comments": "error", - "object-curly-spacing": ["error", "never"], - "prefer-arrow-callback": "error", - "prefer-const": ["error", {"destructuring": "all"}], - "prefer-template": "error", - "prefer-spread": "off", - // @typescript-eslint/quotes requires standard quotes rule to be turned off - "quotes": "off", - "@typescript-eslint/quotes": ["error", "single"], - "no-redeclare": "off", - "@typescript-eslint/no-redeclare": ["error"], - "space-before-function-paren": "off", - "template-curly-spacing": "error", - "no-useless-escape": "off", - // @typescript-eslint/indent requires standard indent rule to be turned off - "indent": "off", - "@typescript-eslint/indent": ["error"], - "no-multiple-empty-lines": [ "error", { - "max": 1 - }], - "import/no-relative-packages": ["error"], - "tsdoc/syntax": "warn", - // Jest https://www.npmjs.com/package/eslint-plugin-jest - "jest/no-commented-out-tests": "error", - "jest/no-disabled-tests": "warn", - "jest/no-focused-tests": "error", - "jest/prefer-to-contain": "warn", - "jest/prefer-to-have-length": "warn", - "jest/valid-expect": "error", - "jest/prefer-to-be": "warn", - "jest/no-alias-methods": "warn", - "jest/no-interpolation-in-snapshots": "warn", - "jest/no-large-snapshots": ["warn", { "maxSize": 50, "inlineMaxSize": 20 }], - "jest/no-deprecated-functions": "warn" - }, - "reportUnusedDisableDirectives": true, - "ignorePatterns": ["build/*.js", "*.json"], - "globals": { - "performance": true - }, - "env": { - "es6": true, - "browser": false - } -} diff --git a/build/generate-doc-images.ts b/build/generate-doc-images.ts index fdf99c7da6..5ce312095c 100644 --- a/build/generate-doc-images.ts +++ b/build/generate-doc-images.ts @@ -34,7 +34,7 @@ async function createImage(exampleName) { const waitTime = (exampleName.includes('3d-model') || exampleName.includes('globe')) ? 5000 : 1500; console.log(`waiting for ${waitTime} ms`); await new Promise(resolve => setTimeout(resolve, waitTime)); - } catch (err) { + } catch { // map.loaded() does not evaluate to true within 3 seconds, it's probably an animated example. // In this case we take the screenshot immediately. console.log(`Timed out waiting for map load on ${exampleName}.`); diff --git a/build/generate-struct-arrays.ts b/build/generate-struct-arrays.ts index 257e06bdeb..009a12df79 100644 --- a/build/generate-struct-arrays.ts +++ b/build/generate-struct-arrays.ts @@ -407,7 +407,7 @@ export class ${structArrayClass} extends ${structArrayLayoutClass} {`); output.push( ` /** * Return the ${structTypeClass} at the given location in the array. - * @param index The index of the element. + * @param index - The index of the element. */ get(index: number): ${structTypeClass} { return new ${structTypeClass}(this, index); diff --git a/build/rollup_plugins.ts b/build/rollup_plugins.ts index d5d525b79b..1016b4e866 100644 --- a/build/rollup_plugins.ts +++ b/build/rollup_plugins.ts @@ -33,7 +33,6 @@ export const plugins = (production: boolean, minified: boolean): Plugin[] => [ }), minified && terser({ compress: { - // eslint-disable-next-line camelcase pure_getters: true, passes: 3 }, diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000..9590d35e19 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,157 @@ +import typescriptEslint from '@typescript-eslint/eslint-plugin'; +import stylisticTs from '@stylistic/eslint-plugin-ts' +import tsdoc from 'eslint-plugin-tsdoc'; +import jest from 'eslint-plugin-jest'; +import globals from 'globals'; +import tsParser from '@typescript-eslint/parser'; +import react from 'eslint-plugin-react'; +import html from 'eslint-plugin-html'; + +export default [ + { + ignores: ['build/*.js', 'staging/**', 'coverage/**', 'node_modules/**', 'docs/**', 'dist/**'] + }, + { + ignores: ['test/bench/**'], + files: ['**/*.ts', '**/*.js'], + plugins: { + '@typescript-eslint': typescriptEslint, + '@stylistic': stylisticTs, + tsdoc, + jest, + }, + + linterOptions: { + reportUnusedDisableDirectives: true, + }, + + languageOptions: { + globals: { + ...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])), + performance: true, + }, + + parser: tsParser, + ecmaVersion: 5, + sourceType: 'module', + + parserOptions: { + createDefaultProgram: true, + }, + }, + + rules: { + 'no-dupe-class-members': 'off', + '@typescript-eslint/no-dupe-class-members': ['error'], + + '@typescript-eslint/no-unused-vars': ['warn', { + argsIgnorePattern: '^_', + }], + + '@stylistic/member-delimiter-style': ['error'], + 'no-useless-constructor': 'off', + '@typescript-eslint/no-useless-constructor': ['error'], + 'no-undef': 'off', + 'no-use-before-define': 'off', + 'no-duplicate-imports': 'off', + 'implicit-arrow-linebreak': 'off', + 'arrow-parens': 'off', + 'arrow-body-style': 'off', + 'no-confusing-arrow': 'off', + 'no-control-regex': 'off', + 'no-invalid-this': 'off', + 'no-buffer-constructor': 'off', + 'array-bracket-spacing': 'error', + 'consistent-return': 'off', + 'global-require': 'off', + 'key-spacing': 'error', + 'no-eq-null': 'off', + 'no-lonely-if': 'off', + 'no-new': 'off', + + 'no-restricted-properties': [2, { + object: 'Object', + property: 'assign', + }], + + 'no-unused-vars': 'off', + 'no-warning-comments': 'error', + 'object-curly-spacing': ['error', 'never'], + 'prefer-arrow-callback': 'error', + + 'prefer-const': ['error', { + destructuring: 'all', + }], + + 'prefer-template': 'error', + 'prefer-spread': 'off', + quotes: 'off', + '@stylistic/quotes': ['error', 'single'], + 'no-redeclare': 'off', + '@typescript-eslint/no-redeclare': ['error'], + 'space-before-function-paren': 'off', + 'template-curly-spacing': 'error', + 'no-useless-escape': 'off', + indent: 'off', + '@stylistic/indent': ['error'], + + 'no-multiple-empty-lines': ['error', { + max: 1, + }], + + 'tsdoc/syntax': 'warn', + 'jest/no-commented-out-tests': 'error', + 'jest/no-disabled-tests': 'warn', + 'jest/no-focused-tests': 'error', + 'jest/prefer-to-contain': 'warn', + 'jest/prefer-to-have-length': 'warn', + 'jest/valid-expect': 'error', + 'jest/prefer-to-be': 'warn', + 'jest/no-alias-methods': 'warn', + 'jest/no-interpolation-in-snapshots': 'warn', + + 'jest/no-large-snapshots': ['warn', { + maxSize: 50, + inlineMaxSize: 20, + }], + + 'jest/no-deprecated-functions': 'warn', + }, + }, + { + files: ['**/*.html'], + plugins: { + html + }, + rules: { + 'no-restricted-properties': 'off', + 'new-cap': 'off', + '@typescript-eslint/no-unused-vars': 'off' + } + }, + { + files: ['test/bench/**/*.jsx', 'test/bench/**/*.js', 'test/bench/**/*.ts'], + plugins: { + react + }, + rules: { + 'react/jsx-uses-vars': [2], + 'no-restricted-properties': 'off' + }, + languageOptions: { + globals: { + ...Object.fromEntries(Object.entries(globals.browser).map(([key]) => [key, 'off'])), + performance: true, + }, + + parser: tsParser, + ecmaVersion: 5, + sourceType: 'module', + + parserOptions: { + createDefaultProgram: true, + }, + }, + }, + +]; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 065cb701e3..9c8f5a2406 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,12 +46,13 @@ "@rollup/plugin-strip": "^3.0.4", "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^12.1.1", + "@stylistic/eslint-plugin-ts": "^2.9.0", "@types/benchmark": "^2.1.5", "@types/cssnano": "^5.0.0", "@types/d3": "^7.4.3", "@types/diff": "^5.2.3", "@types/earcut": "^2.1.4", - "@types/eslint": "^8.56.7", + "@types/eslint": "^9.6.1", "@types/gl": "^6.0.5", "@types/glob": "^8.1.0", "@types/jest": "^29.5.13", @@ -68,8 +69,8 @@ "@types/request": "^2.48.12", "@types/shuffle-seed": "^1.1.3", "@types/window-or-global": "^1.0.6", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", + "@typescript-eslint/eslint-plugin": "^8.10.0", + "@typescript-eslint/parser": "^8.10.0", "address": "^2.0.3", "autoprefixer": "^10.4.20", "benchmark": "^2.1.4", @@ -81,8 +82,7 @@ "devtools-protocol": "^0.0.1368592", "diff": "^7.0.0", "dts-bundle-generator": "^9.5.1", - "eslint": "^8.57.0", - "eslint-config-mourner": "^3.0.0", + "eslint": "^9.13.0", "eslint-plugin-html": "^8.1.2", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.8.3", @@ -90,6 +90,7 @@ "eslint-plugin-tsdoc": "0.3.0", "expect": "^29.7.0", "glob": "^11.0.0", + "globals": "^15.11.0", "is-builtin-module": "^4.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", @@ -700,6 +701,15 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/types": { "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", @@ -1333,24 +1343,47 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.1.tgz", + "integrity": "sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", + "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "dev": true, + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", + "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", + "dev": true, + "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.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", "dev": true, "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", @@ -1358,7 +1391,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" @@ -1371,15 +1404,12 @@ "dev": true }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1397,39 +1427,56 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "node_modules/@eslint/js": { + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", + "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", "dev": true, "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.1.tgz", + "integrity": "sha512-HFZ4Mp26nbWk9d/BpvP0YNL6W4UoZF0VFcTw/aPPA8RpOxeFQgK+ClABGgAUXs9Y/RGX/l1vOmrqz1MQt9MNuw==", + "dev": true, + "dependencies": { + "levn": "^0.4.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "node_modules/@humanfs/core": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz", + "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=18.18.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "node_modules/@humanfs/node": { + "version": "0.16.5", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz", + "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@humanfs/core": "^0.19.0", + "@humanwhocodes/retry": "^0.3.0" }, "engines": { - "node": ">=10.10.0" + "node": ">=18.18.0" } }, "node_modules/@humanwhocodes/module-importer": { @@ -1444,11 +1491,18 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", - "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", - "dev": true + "node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@isaacs/cliui": { "version": "8.0.2", @@ -2680,6 +2734,35 @@ "integrity": "sha512-DE427ROAphMQzU4ENbliGYrBSYPXF+TtLg9S8vzeA+OF4ZKzoDdzfL8sxuMUGS/lgRhM6j1URSk9ghf7Xo1tyA==", "dev": true }, + "node_modules/@stylistic/eslint-plugin-ts": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-ts/-/eslint-plugin-ts-2.9.0.tgz", + "integrity": "sha512-CxB73paAKlmaIDtOfKoIHlhNJVlyRMVobuBqdOc4wbVSqfhbgpCWuJYpBkV3ydGDKRfVWNJ9yg5b99lzZtrjhg==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "^8.8.0", + "eslint-visitor-keys": "^4.1.0", + "espree": "^10.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=8.40.0" + } + }, + "node_modules/@stylistic/eslint-plugin-ts/node_modules/eslint-visitor-keys": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", + "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "dev": true, @@ -3019,9 +3102,9 @@ "dev": true }, "node_modules/@types/eslint": { - "version": "8.56.7", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.7.tgz", - "integrity": "sha512-SjDvI/x3zsZnOkYZ3lCt9lOZWZLB2jIlNKz+LBgCtDurK0JZcwucxYHn1w2BJkD34dgX9Tjnak0txtq4WTggEA==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", "dev": true, "dependencies": { "@types/estree": "*", @@ -3325,31 +3408,31 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", - "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.10.0.tgz", + "integrity": "sha512-phuB3hoP7FFKbRXxjl+DRlQDuJqhpOnm5MmtROXyWi3uS/Xg2ZXqiQfcG2BJHiN4QKyzdOJi3NEn/qTnjUlkmQ==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/type-utils": "7.18.0", - "@typescript-eslint/utils": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.10.0", + "@typescript-eslint/type-utils": "8.10.0", + "@typescript-eslint/utils": "8.10.0", + "@typescript-eslint/visitor-keys": "8.10.0", "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.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -3358,26 +3441,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", - "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.10.0.tgz", + "integrity": "sha512-E24l90SxuJhytWJ0pTQydFT46Nk0Z+bsLKo/L8rtQSL93rQ6byd1V/QbDpHUTdLPOMsBCcYXZweADNCfOCmOAg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/scope-manager": "8.10.0", + "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/typescript-estree": "8.10.0", + "@typescript-eslint/visitor-keys": "8.10.0", "debug": "^4.3.4" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -3386,16 +3469,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", - "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.10.0.tgz", + "integrity": "sha512-AgCaEjhfql9MDKjMUxWvH7HjLeBqMCBfIaBbzzIcBbQPZE7CPh1m6FF+L75NUMJFMLYhCywJXIDEMa3//1A0dw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0" + "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/visitor-keys": "8.10.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -3403,26 +3486,23 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", - "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.10.0.tgz", + "integrity": "sha512-PCpUOpyQSpxBn230yIcK+LeCQaXuxrgCm2Zk1S+PTIRJsEfU6nJ0TtwyH8pIwPK/vJoA+7TZtzyAJSGBz+s/dg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.18.0", - "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/typescript-estree": "8.10.0", + "@typescript-eslint/utils": "8.10.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependencies": { - "eslint": "^8.56.0" - }, "peerDependenciesMeta": { "typescript": { "optional": true @@ -3430,12 +3510,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", - "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.10.0.tgz", + "integrity": "sha512-k/E48uzsfJCRRbGLapdZgrX52csmWJ2rcowwPvOZ8lwPUv3xW6CcFeJAXgx4uJm+Ge4+a4tFOkdYvSpxhRhg1w==", "dev": true, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -3443,22 +3523,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", - "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.10.0.tgz", + "integrity": "sha512-3OE0nlcOHaMvQ8Xu5gAfME3/tWVDpb/HxtpUZ1WeOAksZ/h/gwrBzCklaGzwZT97/lBbbxJ16dMA98JMEngW4w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/visitor-keys": "7.18.0", + "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/visitor-keys": "8.10.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "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.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -3495,38 +3575,38 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", - "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.10.0.tgz", + "integrity": "sha512-Oq4uZ7JFr9d1ZunE/QKy5egcDRXT/FrS2z/nlxzPua2VHFtmMvFNDvpq1m/hq0ra+T52aUezfcjGRIB7vNJF9w==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.18.0", - "@typescript-eslint/types": "7.18.0", - "@typescript-eslint/typescript-estree": "7.18.0" + "@typescript-eslint/scope-manager": "8.10.0", + "@typescript-eslint/types": "8.10.0", + "@typescript-eslint/typescript-estree": "8.10.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", - "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.10.0.tgz", + "integrity": "sha512-k8nekgqwr7FadWk548Lfph6V3r9OVqjzAIVskE7orMZR23cGJjAOVazsZSJW+ElyjfTM4wx/1g88Mi70DDtG9A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/types": "8.10.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -6008,17 +6088,6 @@ "node": ">=8" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "dev": true, - "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", @@ -6408,65 +6477,65 @@ } }, "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", + "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", + "@eslint-community/regexpp": "^4.11.0", + "@eslint/config-array": "^0.18.0", + "@eslint/core": "^0.7.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.13.0", + "@eslint/plugin-kit": "^0.2.0", + "@humanfs/node": "^0.16.5", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.3.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "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.1.0", + "eslint-visitor-keys": "^4.1.0", + "espree": "^10.2.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" }, "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-mourner": { - "version": "3.0.0", - "dev": true, - "license": "ISC" - }, "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", @@ -6710,6 +6779,22 @@ "@microsoft/tsdoc-config": "0.17.0" } }, + "node_modules/eslint-scope": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz", + "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", @@ -6722,11 +6807,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/argparse": { - "version": "2.0.1", - "dev": true, - "license": "Python-2.0" - }, "node_modules/eslint/node_modules/cross-spawn": { "version": "7.0.3", "dev": true, @@ -6751,17 +6831,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/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==", + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", + "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", "dev": true, - "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" @@ -6793,31 +6869,6 @@ "node": ">=10.13.0" } }, - "node_modules/eslint/node_modules/globals": { - "version": "13.19.0", - "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/js-yaml": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/eslint/node_modules/locate-path": { "version": "6.0.0", "dev": true, @@ -6874,17 +6925,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.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", + "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==", "dev": true, "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.12.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.1.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" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", + "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -6916,8 +6979,9 @@ }, "node_modules/esrecurse": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -7174,14 +7238,15 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, - "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": { @@ -7248,17 +7313,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==", "dev": true, "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": { @@ -7775,11 +7839,15 @@ } }, "node_modules/globals": { - "version": "11.12.0", + "version": "15.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.11.0.tgz", + "integrity": "sha512-yeyNSjdbyVaWurlwCpcA6XNBrHTMIeDdj0/hnvX/OLJ9ekOXYbLsLinH/MucQyGvNnXhidTdNhTtJaffL2sMfw==", "dev": true, - "license": "MIT", "engines": { - "node": ">=4" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globalthis": { @@ -8516,14 +8584,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-object": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", @@ -9037,18 +9097,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-config/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/jest-diff": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", @@ -13728,6 +13776,18 @@ "node": ">=6" } }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/stylehacks": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-7.0.4.tgz", @@ -14509,17 +14569,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typed-array-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", diff --git a/package.json b/package.json index d9a9f90a16..078319ea39 100644 --- a/package.json +++ b/package.json @@ -54,12 +54,13 @@ "@rollup/plugin-strip": "^3.0.4", "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^12.1.1", + "@stylistic/eslint-plugin-ts": "^2.9.0", "@types/benchmark": "^2.1.5", "@types/cssnano": "^5.0.0", "@types/d3": "^7.4.3", "@types/diff": "^5.2.3", "@types/earcut": "^2.1.4", - "@types/eslint": "^8.56.7", + "@types/eslint": "^9.6.1", "@types/gl": "^6.0.5", "@types/glob": "^8.1.0", "@types/jest": "^29.5.13", @@ -76,8 +77,8 @@ "@types/request": "^2.48.12", "@types/shuffle-seed": "^1.1.3", "@types/window-or-global": "^1.0.6", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", + "@typescript-eslint/eslint-plugin": "^8.10.0", + "@typescript-eslint/parser": "^8.10.0", "address": "^2.0.3", "autoprefixer": "^10.4.20", "benchmark": "^2.1.4", @@ -89,8 +90,7 @@ "devtools-protocol": "^0.0.1368592", "diff": "^7.0.0", "dts-bundle-generator": "^9.5.1", - "eslint": "^8.57.0", - "eslint-config-mourner": "^3.0.0", + "eslint": "^9.13.0", "eslint-plugin-html": "^8.1.2", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jest": "^28.8.3", @@ -98,6 +98,7 @@ "eslint-plugin-tsdoc": "0.3.0", "expect": "^29.7.0", "glob": "^11.0.0", + "globals": "^15.11.0", "is-builtin-module": "^4.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", @@ -163,7 +164,7 @@ "start-docs": "docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material", "start": "run-p watch-css watch-dev start-server", "start-bench": "run-p watch-css watch-benchmarks start-server", - "lint": "eslint --cache --ext .ts,.tsx,.js,.html --ignore-path .gitignore .", + "lint": "eslint", "lint-css": "stylelint **/*.css --fix -f verbose", "test": "run-p lint lint-css test-render jest", "jest": "jest", diff --git a/src/geo/lng_lat.test.ts b/src/geo/lng_lat.test.ts index 2833a7f10b..79039d35ea 100644 --- a/src/geo/lng_lat.test.ts +++ b/src/geo/lng_lat.test.ts @@ -5,12 +5,10 @@ describe('LngLat', () => { expect(new LngLat(0, 0) instanceof LngLat).toBeTruthy(); expect(() => { - /*eslint no-new: 0*/ new LngLat(0, -91); }).toThrow('Invalid LngLat latitude value: must be between -90 and 90'); expect(() => { - /*eslint no-new: 0*/ new LngLat(0, 91); }).toThrow('Invalid LngLat latitude value: must be between -90 and 90'); }); diff --git a/src/gl/context.ts b/src/gl/context.ts index aa3749ae89..2e2d4cae6e 100644 --- a/src/gl/context.ts +++ b/src/gl/context.ts @@ -65,7 +65,6 @@ export class Context { pixelStoreUnpackPremultiplyAlpha: PixelStoreUnpackPremultiplyAlpha; pixelStoreUnpackFlipY: PixelStoreUnpackFlipY; - // eslint-disable-next-line camelcase extTextureFilterAnisotropic: EXT_texture_filter_anisotropic | null; extTextureFilterAnisotropicMax?: GLfloat; HALF_FLOAT?: GLenum; diff --git a/src/render/terrain.test.ts b/src/render/terrain.test.ts index 7b6cc89368..5d0c3f5e52 100644 --- a/src/render/terrain.test.ts +++ b/src/render/terrain.test.ts @@ -259,7 +259,6 @@ describe('Terrain', () => { getDEMElevation: Terrain.prototype.getDEMElevation, getTerrainData() { return { - // eslint-disable-next-line camelcase u_terrain_matrix: mat4.create(), tile: { dem: { diff --git a/src/source/geojson_source.test.ts b/src/source/geojson_source.test.ts index f3f9042a27..1ad4b27958 100644 --- a/src/source/geojson_source.test.ts +++ b/src/source/geojson_source.test.ts @@ -383,7 +383,7 @@ describe('GeoJSONSource#update', () => { test('fires "error"', () => new Promise(done => { const mockDispatcher = wrapDispatcher({ sendAsync(_message) { - return Promise.reject('error'); // eslint-disable-line prefer-promise-reject-errors + return Promise.reject('error'); } }); diff --git a/src/source/geojson_worker_source.ts b/src/source/geojson_worker_source.ts index 8f6689071c..2a43c67f7d 100644 --- a/src/source/geojson_worker_source.ts +++ b/src/source/geojson_worker_source.ts @@ -226,7 +226,7 @@ export class GeoJSONWorkerSource extends VectorTileWorkerSource { const parsed = JSON.parse(params.data); this._dataUpdateable = isUpdateableGeoJSON(parsed, promoteId) ? toUpdateable(parsed, promoteId) : undefined; return parsed; - } catch (e) { + } catch { throw new Error(`Input data given to '${params.source}' is not a valid GeoJSON object.`); } } diff --git a/src/source/raster_dem_tile_source.ts b/src/source/raster_dem_tile_source.ts index de1a13b730..ba04d92c50 100644 --- a/src/source/raster_dem_tile_source.ts +++ b/src/source/raster_dem_tile_source.ts @@ -86,13 +86,11 @@ export class RasterDEMTileSource extends RasterTileSource implements Source { if (!tile.actor || tile.state === 'expired') { tile.actor = this.dispatcher.getActor(); - /* eslint-disable require-atomic-updates */ const data = await tile.actor.sendAsync({type: MessageType.loadDEMTile, data: params}); tile.dem = data; tile.needsHillshadePrepare = true; tile.needsTerrainPrepare = true; tile.state = 'loaded'; - /* eslint-enable require-atomic-updates */ } } } catch (err) { @@ -112,7 +110,7 @@ export class RasterDEMTileSource extends RasterTileSource implements Source { const height = img.height + 2; try { return new RGBAImage({width, height}, await readImageUsingVideoFrame(img, -1, -1, width, height)); - } catch (e) { + } catch { // fall-back to browser canvas decoding } } diff --git a/src/source/tile_id.test.ts b/src/source/tile_id.test.ts index 56c7147903..bfbb31a689 100644 --- a/src/source/tile_id.test.ts +++ b/src/source/tile_id.test.ts @@ -4,19 +4,15 @@ import {MAX_TILE_ZOOM, MIN_TILE_ZOOM} from '../util/util'; describe('CanonicalTileID', () => { test('#constructor', () => { expect(() => { - /*eslint no-new: 0*/ new CanonicalTileID(MIN_TILE_ZOOM - 1, 0, 0); }).toThrow(); expect(() => { - /*eslint no-new: 0*/ new CanonicalTileID(MAX_TILE_ZOOM + 1, 0, 0); }).toThrow(); expect(() => { - /*eslint no-new: 0*/ new CanonicalTileID(2, 4, 0); }).toThrow(); expect(() => { - /*eslint no-new: 0*/ new CanonicalTileID(2, 0, 4); }).toThrow(); }); diff --git a/src/util/geolocation_support.ts b/src/util/geolocation_support.ts index 30af11ff64..98323d8981 100644 --- a/src/util/geolocation_support.ts +++ b/src/util/geolocation_support.ts @@ -14,10 +14,10 @@ export async function checkGeolocationSupport(forceRecalculation = false): Promi // insecure origin try { const permissions = await window.navigator.permissions.query({name: 'geolocation'}); - supportsGeolocation = permissions.state !== 'denied'; // eslint-disable-line require-atomic-updates + supportsGeolocation = permissions.state !== 'denied'; } catch { // Fix for iOS16 which rejects query but still supports geolocation - supportsGeolocation = !!window.navigator.geolocation; // eslint-disable-line require-atomic-updates + supportsGeolocation = !!window.navigator.geolocation; } return supportsGeolocation; } diff --git a/src/util/image_request.test.ts b/src/util/image_request.test.ts index 93ffca8252..ed9e67d9da 100644 --- a/src/util/image_request.test.ts +++ b/src/util/image_request.test.ts @@ -225,7 +225,6 @@ describe('ImageRequest', () => { test('Cancel: getImage request cancelled for HTTPImageRequest', async () => { let imageUrl; const requestUrl = 'test'; - // eslint-disable-next-line accessor-pairs Object.defineProperty(global.Image.prototype, 'src', { set(url: string) { imageUrl = url; diff --git a/src/util/script_detection.ts b/src/util/script_detection.ts index 4043e4e043..f31e6eb873 100644 --- a/src/util/script_detection.ts +++ b/src/util/script_detection.ts @@ -1,5 +1,3 @@ -/* eslint-disable new-cap */ - import {unicodeBlockLookup as isChar} from './is_char_in_unicode_block'; export function allowsIdeographicBreaking(chars: string) { @@ -31,7 +29,7 @@ function sanitizedRegExpFromScriptCodes(scriptCodes: Array): RegExp { const supportedPropertyEscapes = scriptCodes.map(code => { try { return new RegExp(`\\p{sc=${code}}`, 'u').source; - } catch (e) { + } catch { return null; } }).filter(pe => pe); diff --git a/src/util/test/util.ts b/src/util/test/util.ts index 0bc96fe45e..5be8154b4b 100644 --- a/src/util/test/util.ts +++ b/src/util/test/util.ts @@ -153,7 +153,6 @@ export function stubAjaxGetImage(createImageBitmap) { global.URL.revokeObjectURL = () => {}; global.URL.createObjectURL = (_) => { return null; }; - // eslint-disable-next-line accessor-pairs Object.defineProperty(global.Image.prototype, 'src', { set(url: string) { if (url === 'error') { diff --git a/src/util/util.ts b/src/util/util.ts index d849e31b34..9eb840907e 100644 --- a/src/util/util.ts +++ b/src/util/util.ts @@ -617,7 +617,7 @@ export function storageAvailable(type: string): boolean { storage.setItem('_mapbox_test_', 1); storage.removeItem('_mapbox_test_'); return true; - } catch (e) { + } catch { return false; } } @@ -838,7 +838,7 @@ export async function getImageData( if (isOffscreenCanvasDistorted()) { try { return await readImageUsingVideoFrame(image, x, y, width, height); - } catch (e) { + } catch { // fall back to OffscreenCanvas } } diff --git a/src/util/web_worker_transfer.ts b/src/util/web_worker_transfer.ts index a8f1cd4325..d3d2df0788 100644 --- a/src/util/web_worker_transfer.ts +++ b/src/util/web_worker_transfer.ts @@ -191,7 +191,7 @@ export function serialize(input: unknown, transferables?: Array | if (!klass.serialize) { for (const key in input) { - if (!input.hasOwnProperty(key)) continue; // eslint-disable-line no-prototype-builtins + if (!input.hasOwnProperty(key)) continue; if (registry[classRegistryKey].omit.indexOf(key) >= 0) continue; const property = input[key]; properties[key] = registry[classRegistryKey].shallow.indexOf(key) >= 0 ? diff --git a/src/util/webp_supported.ts b/src/util/webp_supported.ts index 7628b0aa9b..056a09f2bc 100755 --- a/src/util/webp_supported.ts +++ b/src/util/webp_supported.ts @@ -53,7 +53,7 @@ function testWebpTextureUpload(gl: WebGLRenderingContext|WebGL2RenderingContext) if (gl.isContextLost()) return; webpSupported.supported = true; - } catch (e) { + } catch { // Catch "Unspecified Error." in Edge 18. } diff --git a/test/bench/.eslintrc.json b/test/bench/.eslintrc.json deleted file mode 100644 index 769e1e778f..0000000000 --- a/test/bench/.eslintrc.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "parserOptions": { - "ecmaFeatures": { - "jsx": true - } - }, - "plugins": [ - "react" - ], - "rules": { - "react/jsx-uses-vars": [2], - "no-restricted-properties": "off" - }, - "env": { - "browser": true - } -} diff --git a/test/bench/gl-stats.html b/test/bench/gl-stats.html index 8b459b459b..bc0c817a57 100644 --- a/test/bench/gl-stats.html +++ b/test/bench/gl-stats.html @@ -8,7 +8,7 @@ diff --git a/test/bench/versions/index.html b/test/bench/versions/index.html index d41b59004b..edd4ad2683 100644 --- a/test/bench/versions/index.html +++ b/test/bench/versions/index.html @@ -55,7 +55,7 @@ } const results = await window.Benchmarks.run(benchmarks); - // eslint-disable-next-line require-atomic-updates + window.maplibreglBenchmarkResults = {}; for (const result of results) { window.maplibreglBenchmarkResults[result.name] = {}; @@ -63,7 +63,7 @@ window.maplibreglBenchmarkResults[result.name][version.name] = {name: version.name, summary: version.summary, regression: version.regression}; } } - // eslint-disable-next-line require-atomic-updates + window.maplibreglBenchmarkFinished = true; } catch (ex) { console.error(ex); diff --git a/test/build/min.test.ts b/test/build/min.test.ts index 13aec8c134..c9594b1f4a 100644 --- a/test/build/min.test.ts +++ b/test/build/min.test.ts @@ -9,6 +9,7 @@ describe('test min build', () => { // confirm that the entire package.json isn't present by asserting // the absence of each of our script strings for (const name in packageJson.scripts) { + if (packageJson.scripts[name].length < 10) continue; // skip short names like "lint" expect(minBundle.includes(packageJson.scripts[name])).toBeFalsy(); } }); diff --git a/test/examples/.eslintrc.json b/test/examples/.eslintrc.json deleted file mode 100644 index 80242dbdce..0000000000 --- a/test/examples/.eslintrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "plugins": [ - "html" - ], - "rules": { - "no-restricted-properties": "off", - "new-cap": "off", - "@typescript-eslint/no-unused-vars": "off" - } -} diff --git a/test/examples/filter-within-layer.html b/test/examples/filter-within-layer.html index 91a27b376a..d13af48b0e 100644 --- a/test/examples/filter-within-layer.html +++ b/test/examples/filter-within-layer.html @@ -147,7 +147,6 @@ felt = document.getElementById('range-felt'); operator = operatorFelt.value; - // eslint-disable-next-line no-unused-expressions e.target.checked ? data.felt = Number(felt.value) : delete data['felt']; break; @@ -158,18 +157,15 @@ mag = document.getElementById('range-mag'); operator = operatorMag.value; - // eslint-disable-next-line no-unused-expressions e.target.checked ? data.mag = Number(mag.value) : delete data['mag']; break; /// example: `map.setFilter("earthquakes", ["any", [">", "tsunami", 0]])` case 'tsunami': - // eslint-disable-next-line @typescript-eslint/quotes - tsunami = document.querySelector("input[type='radio'][name=tsunami]:checked"); + tsunami = document.querySelector('input[type="radio"][name=tsunami]:checked'); operator = '=='; - // eslint-disable-next-line no-unused-expressions e.target.checked ? data.tsunami = Number(tsunami.value) : delete data['tsunami']; break; diff --git a/test/examples/geocoder.html b/test/examples/geocoder.html index 427c0eaa74..26f7d63c46 100644 --- a/test/examples/geocoder.html +++ b/test/examples/geocoder.html @@ -21,7 +21,6 @@ />