From 31b6840013bf5223e9b10d6d763daa094a04cd5f Mon Sep 17 00:00:00 2001 From: k2snowman69 Date: Fri, 24 Jan 2025 22:35:01 -0800 Subject: [PATCH] Update typescript and eslint --- CHANGELOG.md | 5 + package-lock.json | 634 +++++++++--------- package.json | 8 +- src-playground/README.md | 2 +- .../create-program/createIsolatedProgram.js | 2 +- .../create-program/createProjectProgram.js | 2 +- .../create-program/createProjectService.js | 2 +- .../dist/create-program/describeFilePath.js | 2 +- .../dist/create-program/getScriptKind.js | 39 ++ .../getWatchProgramsForProjects.js | 2 +- .../dist/create-program/shared.js | 2 +- .../create-program/useProvidedPrograms.js | 4 +- .../dist/jsx/xhtml-entities.js | 2 +- .../dist/parseSettings/ExpiringCache.js | 4 +- .../dist/parseSettings/createParseSettings.js | 3 +- .../parseSettings/getProjectConfigFiles.js | 2 +- .../dist/parseSettings/inferSingleRun.js | 2 +- .../dist/parseSettings/resolveProjectList.js | 2 +- .../dist/parseSettings/warnAboutTSVersion.js | 2 +- .../dist/semantic-or-syntactic-errors.js | 2 +- .../typescript-estree/dist/simple-traverse.js | 2 +- .../dist/useProgramFromProjectService.js | 2 +- .../typescript-estree/dist/version-check.js | 2 +- .../mocks/cosmiconfig/dist/index.js | 2 +- .../mocks/flow-parser/flow_parser.js | 2 +- src-playground/mocks/path.ts | 235 ------- src-playground/package.json | 2 +- src/language-js/sortContents/index.ts | 52 +- 28 files changed, 427 insertions(+), 595 deletions(-) create mode 100644 src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js delete mode 100644 src-playground/mocks/path.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index b3291a790..cd349eb53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Updated our typescript parsing dependencies + - eslint-typescript@8.x.x + - typescript@5.x.x +- Fixed bug when sortContents is enabled, sometimes member functions aren't sorted + ## [2.0.2] - 2023-09-30 - Fixed files with special characters not being recognized (ex. `./src/[...something].ts`) diff --git a/package-lock.json b/package-lock.json index 80f0790dd..d62b103af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "dependencies": { "@types/estree": "~1.0.0", "@types/postcss-less": "^4.0.0", - "@typescript-eslint/typescript-estree": "^5.8.0", + "@typescript-eslint/typescript-estree": "^8.0.0", "angular-html-parser": "^8.0.0", "cosmiconfig": "^9.0.0", "find-up": "^7.0.0", @@ -33,13 +33,13 @@ "@release-it/keep-a-changelog": "6.0.0", "@snowcoders/renovate-config": "3.0.0-beta.17", "@types/node": "22.10.10", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", + "@typescript-eslint/eslint-plugin": "8.21.0", + "@typescript-eslint/parser": "8.21.0", "changelog-updater": "2.0.3", "concurrently": "9.1.2", "cpy-cli": "5.0.0", "docsify-cli": "4.4.4", - "eslint": "8.57.1", + "eslint": "9.19.0", "eslint-config-prettier": "10.0.1", "eslint-plugin-import": "2.31.0", "eslint-plugin-prettier": "5.2.3", @@ -615,39 +615,68 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz", - "integrity": "sha512-gB8T4H4DEfX2IV9zGDJPOBgP1e/DbfCPDTtEqUMckpvzS1OYtva8JdFYBqMwYk7xAQ429WGF/UPqn8uQ//h2vQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "node_modules/@eslint-community/regexpp": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", - "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz", + "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==", + "dev": true, + "dependencies": { + "@eslint/object-schema": "^2.1.5", + "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.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "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", @@ -655,7 +684,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" @@ -666,35 +695,74 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4" } }, "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.19.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.19.0.tgz", + "integrity": "sha512-rbq9/g38qjfqFLOVPvwjIvFFdNziEC5S65jmjPw5r6A//QH+W91akh9irMwjDN8zKUTak6W9EsAv4m/7Wnw0UQ==", "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/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", + "node_modules/@eslint/object-schema": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz", + "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", + "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@eslint/core": "^0.10.0", + "levn": "^0.4.1" }, "engines": { - "node": ">=10.10.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/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/@humanwhocodes/module-importer": { @@ -710,13 +778,18 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", + "node_modules/@humanwhocodes/retry": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true, - "license": "BSD-3-Clause" + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@iarna/toml": { "version": "2.2.5", @@ -2199,9 +2272,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/json5": { @@ -2311,12 +2384,6 @@ "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", "dev": true }, - "node_modules/@types/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", - "dev": true - }, "node_modules/@types/send": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", @@ -2415,37 +2482,32 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.21.0.tgz", + "integrity": "sha512-eTH+UOR4I7WbdQnG4Z48ebIA6Bgi7WO8HvFEneeYBxG8qCOYgTOFPSg6ek9ITIDvGjDQzWHcoWHCDO2biByNzA==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.21.0", + "@typescript-eslint/type-utils": "8.21.0", + "@typescript-eslint/utils": "8.21.0", + "@typescript-eslint/visitor-keys": "8.21.0", "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.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": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "@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/eslint-plugin/node_modules/ignore": { @@ -2459,43 +2521,40 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.21.0.tgz", + "integrity": "sha512-Wy+/sdEH9kI3w9civgACwabHbKl+qIOu0uFZ9IMKzX3Jpv9og0ZBJrZExGrPpFAY7rWsXuxs5e7CPPP17A4eYA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/scope-manager": "8.21.0", + "@typescript-eslint/types": "8.21.0", + "@typescript-eslint/typescript-estree": "8.21.0", + "@typescript-eslint/visitor-keys": "8.21.0", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.21.0.tgz", + "integrity": "sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" + "@typescript-eslint/types": "8.21.0", + "@typescript-eslint/visitor-keys": "8.21.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2503,38 +2562,34 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.21.0.tgz", + "integrity": "sha512-95OsL6J2BtzoBxHicoXHxgk3z+9P3BEcQTpBKriqiYzLKnM2DeSqs+sndMKdamU8FosiadQFT3D+BSL9EKnAJQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@typescript-eslint/typescript-estree": "8.21.0", + "@typescript-eslint/utils": "8.21.0", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^2.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.21.0.tgz", + "integrity": "sha512-PAL6LUuQwotLW2a8VsySDBwYMm129vFm4tMVlylzdoTybTHaAi0oBp7Ac6LhSrHHOdLM3efH+nAR6hAWoMF89A==", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -2542,114 +2597,101 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.21.0.tgz", + "integrity": "sha512-x+aeKh/AjAArSauz0GiQZsjT8ciadNMHdkUSwBB9Z6PrKc/4knM4g3UfHml6oDJmKC88a6//cdxnO/+P2LkMcg==", "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", + "@typescript-eslint/types": "8.21.0", + "@typescript-eslint/visitor-keys": "8.21.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "node_modules/@typescript-eslint/typescript-estree/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==", "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dependencies": { + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "engines": { - "node": ">=8" + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.21.0.tgz", + "integrity": "sha512-xcXBfcq0Kaxgj7dwejMbFyq7IOHgpNMtVuDveK7w3ZGwG9owKzhALVwKpTF2yrZmEwl9SWdetf3fxNzJQaVuxw==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.21.0", + "@typescript-eslint/types": "8.21.0", + "@typescript-eslint/typescript-estree": "8.21.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.21.0.tgz", + "integrity": "sha512-BkLMNpdV6prozk8LlyK/SOoWLmUFi+ZD+pcqti9ILCbVvHGk1ui1g4jJOc2WDLaeExz2qWwojxlPce5PljcT3w==", "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "8.21.0", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true + "node_modules/@typescript-eslint/visitor-keys/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==", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", @@ -3187,14 +3229,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "engines": { - "node": ">=8" - } - }, "node_modules/array.prototype.findlastindex": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", @@ -3444,8 +3478,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/basic-ftp": { "version": "5.0.5", @@ -5189,6 +5222,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -5552,18 +5586,6 @@ "resolve-pathname": "^3.0.0" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -6042,59 +6064,62 @@ } }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "version": "9.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.19.0.tgz", + "integrity": "sha512-ug92j0LepKlbbEv6hD911THhoRHmbdXt2gX+VDABAW/Ir7D3nqKdv5Pf5vtlyY6HQMTEP2skXY43ueqTCWssEA==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.10.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.19.0", + "@eslint/plugin-kit": "^0.2.5", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.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", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-prettier": { @@ -6272,6 +6297,7 @@ "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -6280,17 +6306,28 @@ } }, "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==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/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, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -6301,7 +6338,6 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -6376,17 +6412,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.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.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" + } + }, + "node_modules/espree/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, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -6406,9 +6454,9 @@ } }, "node_modules/esquery": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.2.tgz", - "integrity": "sha512-JVSoLdTlTDkmjFmab7H/9SL9qGSyjElT3myyKp7krqjVFQCDLmj1QFaCLRFBszBKI0XVZaiiXvuPIX3ZwHe1Ng==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -6840,15 +6888,15 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "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": { @@ -6955,37 +7003,37 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "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.1.0", - "rimraf": "^3.0.2" + "flatted": "^3.2.9", + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "node_modules/flat-cache/node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/flat-cache/node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "json-buffer": "3.0.1" } }, "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", "dev": true }, "node_modules/flow-parser": { @@ -7376,15 +7424,12 @@ } }, "node_modules/globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", + "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" @@ -10745,12 +10790,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", @@ -11612,6 +11651,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, "engines": { "node": ">=8" } @@ -14589,12 +14629,6 @@ "node": ">=8" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, "node_modules/thingies": { "version": "1.16.0", "resolved": "https://registry.npmjs.org/thingies/-/thingies-1.16.0.tgz", @@ -14712,6 +14746,17 @@ "integrity": "sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw==", "dev": true }, + "node_modules/ts-api-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", + "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/ts-jest": { "version": "29.2.5", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", @@ -14884,25 +14929,6 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, "node_modules/tweezer.js": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/tweezer.js/-/tweezer.js-1.5.0.tgz", @@ -14930,18 +14956,6 @@ "node": ">=4" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -16483,7 +16497,7 @@ "dependencies": { "@types/estree": "~1.0.0", "@types/postcss-less": "^4.0.0", - "@typescript-eslint/typescript-estree": "^5.8.0", + "@typescript-eslint/typescript-estree": "^8.0.0", "angular-html-parser": "^8.0.0", "cosmiconfig": "^9.0.0", "find-up": "^7.0.0", diff --git a/package.json b/package.json index 781016ecc..7eba5820a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "@types/estree": "~1.0.0", "@types/postcss-less": "^4.0.0", - "@typescript-eslint/typescript-estree": "^5.8.0", + "@typescript-eslint/typescript-estree": "^8.0.0", "angular-html-parser": "^8.0.0", "cosmiconfig": "^9.0.0", "find-up": "^7.0.0", @@ -22,13 +22,13 @@ "@release-it/keep-a-changelog": "6.0.0", "@snowcoders/renovate-config": "3.0.0-beta.17", "@types/node": "22.10.10", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", + "@typescript-eslint/eslint-plugin": "8.21.0", + "@typescript-eslint/parser": "8.21.0", "changelog-updater": "2.0.3", "concurrently": "9.1.2", "cpy-cli": "5.0.0", "docsify-cli": "4.4.4", - "eslint": "8.57.1", + "eslint": "9.19.0", "eslint-config-prettier": "10.0.1", "eslint-plugin-import": "2.31.0", "eslint-plugin-prettier": "5.2.3", diff --git a/src-playground/README.md b/src-playground/README.md index 4258d2bb5..d3eb60156 100644 --- a/src-playground/README.md +++ b/src-playground/README.md @@ -6,6 +6,6 @@ Source code for the playground found on the docs site. The folder "mocks" contains mock files that we use to replace real files during the webpack build. This is done to either remove dependencies on node apis (ex. cosmiconfig) or remove functionality we don't use in the web (ex. flow-parser). -Anything within a folder is mocking a node_module. For example "src-playground/mocks/cosmiconfig/dist/index.js" is the mock for "node_modules/cosmiconfig/dist/index.js". These files are dynamically included in the webpack build via the webpack.config.js file. +Anything within a folder is mocking a node_module. For example "src-playground/mocks/cosmiconfig/dist/index.js" is the mock for "node_modules/cosmiconfig/dist/index.js". These files are dynamically included in the webpack build via the webpack.config.js file. It's also important to note that the mocked file needs to match the "module" type defined in the packge.json it's replacing. This is why you'll find some files written in cjs and others in esm. Any files at the root is mocking a node API. These files are dynamically included in the webpack build via the webpack.config.js file. diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js index 96ff18d72..ff3c07ef4 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js @@ -1 +1 @@ -export const createIsolatedProgram = () => {}; +exports.createIsolatedProgram = () => {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js index fbf1f1854..0a6f35b4b 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js @@ -1 +1 @@ -export const createProjectProgram = () => {}; +exports.createProjectProgram = () => {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.js index de005d7be..39870609b 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/createProjectService.js @@ -1 +1 @@ -export const createProjectService = () => {}; +exports.createProjectService = () => {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js index cb0ff5c3b..a6213d667 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js @@ -1 +1 @@ -export {}; +exports = {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js new file mode 100644 index 000000000..62384a6f0 --- /dev/null +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js @@ -0,0 +1,39 @@ +const ts = require("typescript"); +exports.getScriptKind = function (filePath, jsx) { + const extension = filePath.slice(filePath.lastIndexOf(".")).toLowerCase(); + // note - we only respect the user's jsx setting for unknown extensions + // this is so that we always match TS's internal script kind logic, preventing + // weird errors due to a mismatch. + // https://github.com/microsoft/TypeScript/blob/da00ba67ed1182ad334f7c713b8254fba174aeba/src/compiler/utilities.ts#L6948-L6968 + switch (extension) { + case ts.Extension.Cjs: + case ts.Extension.Js: + case ts.Extension.Mjs: + return ts.ScriptKind.JS; + case ts.Extension.Cts: + case ts.Extension.Mts: + case ts.Extension.Ts: + return ts.ScriptKind.TS; + case ts.Extension.Json: + return ts.ScriptKind.JSON; + case ts.Extension.Jsx: + return ts.ScriptKind.JSX; + case ts.Extension.Tsx: + return ts.ScriptKind.TSX; + default: + // unknown extension, force typescript to ignore the file extension, and respect the user's setting + return jsx ? ts.ScriptKind.TSX : ts.ScriptKind.TS; + } +}; +exports.getLanguageVariant = function (scriptKind) { + // https://github.com/microsoft/TypeScript/blob/d6e483b8dabd8fd37c00954c3f2184bb7f1eb90c/src/compiler/utilities.ts#L6281-L6285 + switch (scriptKind) { + case ts.ScriptKind.JS: + case ts.ScriptKind.JSON: + case ts.ScriptKind.JSX: + case ts.ScriptKind.TSX: + return ts.LanguageVariant.JSX; + default: + return ts.LanguageVariant.Standard; + } +}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js index d4893867a..b6ec0149f 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js @@ -1 +1 @@ -export const getWatchProgramsForProjects = () => {}; +exports.getWatchProgramsForProjects = () => {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/shared.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/shared.js index 3b57108d2..7b875c38b 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/shared.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/shared.js @@ -1 +1 @@ -export const ensureAbsolutePath = (path) => path; +exports.ensureAbsolutePath = (path) => path; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js index c1755ccff..10b598e19 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js @@ -1,2 +1,2 @@ -export const useProvidedPrograms = () => {}; -export const createProgramFromConfigFile = () => {}; +exports.useProvidedPrograms = () => {}; +exports.createProgramFromConfigFile = () => {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js index c86fc774e..659a28f57 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js @@ -1 +1 @@ -export const xhtmlEntities = {}; +exports.xhtmlEntities = {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js index 7bc29a74f..8e916ac57 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js @@ -1,2 +1,2 @@ -export const DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = undefined; -export const ExpiringCache = class {}; +exports.DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = undefined; +exports.ExpiringCache = class {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js index 659a5e8f0..5aa1ecb07 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js @@ -1,7 +1,8 @@ -export const createParseSettings = (code, options) => { +exports.createParseSettings = (code, options) => { return { ...options, filePath: "/test.js", code: code, + codeFullText: code, }; }; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js index ee766e488..0636e7aa4 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js @@ -1 +1 @@ -export const resolveProjectList = () => []; +exports.resolveProjectList = () => []; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js index 69af032c7..6973b205d 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js @@ -1 +1 @@ -export const inferSingleRun = () => false; +exports.inferSingleRun = () => false; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js index ee766e488..0636e7aa4 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js @@ -1 +1 @@ -export const resolveProjectList = () => []; +exports.resolveProjectList = () => []; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js index 8e7333980..9f82b1987 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js @@ -1 +1 @@ -export const warnAboutTSVersion = () => {}; +exports.warnAboutTSVersion = () => {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js index 53e2cda04..15be8a1aa 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js @@ -1 +1 @@ -export const getFirstSemanticOrSyntacticError = () => {}; +exports.getFirstSemanticOrSyntacticError = () => {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/simple-traverse.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/simple-traverse.js index 09c5ef73a..9c1c06518 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/simple-traverse.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/simple-traverse.js @@ -1 +1 @@ -export const simpleTraverse = () => {}; +exports.simpleTraverse = () => {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js index 13cfaab75..5059105df 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js @@ -1 +1 @@ -export const useProgramFromProjectService = () => {}; +exports.useProgramFromProjectService = () => {}; diff --git a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/version-check.js b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/version-check.js index 84b8865d7..777ac937b 100644 --- a/src-playground/mocks/@typescript-eslint/typescript-estree/dist/version-check.js +++ b/src-playground/mocks/@typescript-eslint/typescript-estree/dist/version-check.js @@ -1 +1 @@ -export const typescriptVersionIsAtLeast = new Proxy({}, { get: () => true }); +exports.typescriptVersionIsAtLeast = new Proxy({}, { get: () => true }); diff --git a/src-playground/mocks/cosmiconfig/dist/index.js b/src-playground/mocks/cosmiconfig/dist/index.js index c9fa3b10b..c22ff205e 100644 --- a/src-playground/mocks/cosmiconfig/dist/index.js +++ b/src-playground/mocks/cosmiconfig/dist/index.js @@ -1,3 +1,3 @@ -export const cosmiconfigSync = () => { +exports.cosmiconfigSync = () => { return { search: () => null }; }; diff --git a/src-playground/mocks/flow-parser/flow_parser.js b/src-playground/mocks/flow-parser/flow_parser.js index ea9b101e1..ea41b01de 100644 --- a/src-playground/mocks/flow-parser/flow_parser.js +++ b/src-playground/mocks/flow-parser/flow_parser.js @@ -1 +1 @@ -export default function () {} +module.exports = function () {}; diff --git a/src-playground/mocks/path.ts b/src-playground/mocks/path.ts deleted file mode 100644 index 68f28d95d..000000000 --- a/src-playground/mocks/path.ts +++ /dev/null @@ -1,235 +0,0 @@ -/* eslint-disable */ -// @ts-nocheck - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - let up = 0; - for (let i = parts.length - 1; i >= 0; i--) { - const last = parts[i]; - if (last === ".") { - parts.splice(i, 1); - } else if (last === "..") { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift(".."); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -const splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -const splitPath = function (filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -export function resolve() { - let resolvedPath = "", - resolvedAbsolute = false; - - for (let i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - const path = i >= 0 ? arguments[i] : "/"; - - // Skip empty and invalid entries - if (typeof path !== "string") { - throw new TypeError("Arguments to path.resolve must be strings"); - } else if (!path) { - continue; - } - - resolvedPath = path + "/" + resolvedPath; - resolvedAbsolute = path.charAt(0) === "/"; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray( - filter(resolvedPath.split("/"), function (p) { - return !!p; - }), - !resolvedAbsolute, - ).join("/"); - - return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; -} - -// path.normalize(path) -// posix version -export function normalize(path) { - let isPathAbsolute = isAbsolute(path), - trailingSlash = path.endsWith("/"); - - // Normalize the path - path = normalizeArray( - filter(path.split("/"), function (p) { - return !!p; - }), - !isPathAbsolute, - ).join("/"); - - if (!path && !isPathAbsolute) { - path = "."; - } - if (path && trailingSlash) { - path += "/"; - } - - return (isPathAbsolute ? "/" : "") + path; -} - -// posix version -export function isAbsolute(path) { - return path.charAt(0) === "/"; -} - -// posix version -export function join() { - const paths = Array.prototype.slice.call(arguments, 0); - return normalize( - filter(paths, function (p, index) { - if (typeof p !== "string") { - throw new TypeError("Arguments to path.join must be strings"); - } - return p; - }).join("/"), - ); -} - -// path.relative(from, to) -// posix version -export function relative(from, to) { - from = resolve(from).slice(1); - to = resolve(to).slice(1); - - function trim(arr) { - let start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== "") break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== "") break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - const fromParts = trim(from.split("/")); - const toParts = trim(to.split("/")); - - const length = Math.min(fromParts.length, toParts.length); - let samePartsLength = length; - for (let i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - const outputParts = []; - for (let i = samePartsLength; i < fromParts.length; i++) { - outputParts.push(".."); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join("/"); -} - -export var sep = "/"; -export var delimiter = ":"; - -export function dirname(path) { - const result = splitPath(path); - const root = result[0]; - let dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return "."; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.slice(0, -1); - } - - return root + dir; -} - -export function basename(path, ext) { - let f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.slice(-1 * ext.length) === ext) { - f = f.slice(0, f.length - ext.length); - } - return f; -} - -export function extname(path) { - return splitPath(path)[3]; -} - -export default { - basename: basename, - delimiter: delimiter, - dirname: dirname, - extname: extname, - isAbsolute: isAbsolute, - join: join, - normalize: normalize, - relative: relative, - resolve: resolve, - sep: sep, -}; - -function filter(xs, f) { - if (xs.filter) return xs.filter(f); - const res = []; - for (let i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} diff --git a/src-playground/package.json b/src-playground/package.json index 611ea2a51..eeada6957 100644 --- a/src-playground/package.json +++ b/src-playground/package.json @@ -7,7 +7,7 @@ "dependencies": { "@types/estree": "~1.0.0", "@types/postcss-less": "^4.0.0", - "@typescript-eslint/typescript-estree": "^5.8.0", + "@typescript-eslint/typescript-estree": "^8.0.0", "angular-html-parser": "^8.0.0", "cosmiconfig": "^9.0.0", "find-up": "^7.0.0", diff --git a/src/language-js/sortContents/index.ts b/src/language-js/sortContents/index.ts index ffd3f2a5f..d612041ac 100644 --- a/src/language-js/sortContents/index.ts +++ b/src/language-js/sortContents/index.ts @@ -34,7 +34,7 @@ export function sortContents( classItems: any[], comments: any, fileContents: string, - options: SortContentsOptions + options: SortContentsOptions, ): string { return new ClassContentsSorter(className || "", classItems, comments, fileContents, options).sort(); } @@ -47,7 +47,7 @@ class ClassContentsSorter { private classItems: any[], private comments: any, private fileContents: string, - options: SortContentsOptions + options: SortContentsOptions, ) { this.options = this.getValidatedOptions(options); } @@ -75,7 +75,7 @@ class ClassContentsSorter { default: return null; } - } + }, ); const sortableItems: Array = possibleSortableItems.filter((value) => { return value != null; @@ -341,25 +341,33 @@ class ClassContentsSorter { if (node == null) { continue; } - for (const property in node) { - if (property === "type" || property === "loc" || property === "range") { - continue; - } - const value = node[property]; - if (value == null) { - continue; - } else if ( - value != null && - value.object != null && - (value.object.type === "ThisExpression" || value.object.name === this.className) && - value.type === "MemberExpression" && - value.property.name != null - ) { - memberExpressionOrder.push(value.property.name); - } else if (value.type != null) { - memberExpressionOrder.push(...this.getCalleeOrder([value])); - } else if (Array.isArray(value)) { - memberExpressionOrder.push(...this.getCalleeOrder(value)); + // If it's a literal or some other calling type thing + else if ( + node.object != null && + (node.object.type === "ThisExpression" || node.object.name === this.className) && + node.type === "MemberExpression" && + node.property.name != null + ) { + memberExpressionOrder.push(node.property.name); + } + // Check if it contains things to call into + else { + const nodeValues = Object.values(node).flat(); + const nodesToInvestigate = nodeValues.filter((possibleChildNode) => { + const isAstNode = + possibleChildNode != null && typeof possibleChildNode === "object" && "type" in possibleChildNode; + return isAstNode; + }); + if (nodesToInvestigate.length > 0) { + nodesToInvestigate.sort((a, b) => { + const lineDiff = a.loc.start.line - b.loc.start.line; + if (lineDiff === 0) { + return a.loc.start.column - b.loc.start.column; + } else { + return lineDiff; + } + }); + memberExpressionOrder.push(...this.getCalleeOrder(nodesToInvestigate)); } } }