From 62fb8e89f466acf659f150daa826fb505df97d2c Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Thu, 7 Dec 2023 10:43:09 +0300 Subject: [PATCH 1/8] fix: false trigger on jsx linked editing end (e.g. cursor move after opening tag name) --- typescript/src/decorateLinkedEditing.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/typescript/src/decorateLinkedEditing.ts b/typescript/src/decorateLinkedEditing.ts index a21705d..e262a11 100644 --- a/typescript/src/decorateLinkedEditing.ts +++ b/typescript/src/decorateLinkedEditing.ts @@ -11,8 +11,13 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, } | undefined proxy.getLinkedEditingRangeAtPosition = (fileName, position) => { + const scriptSnapshot = languageServiceHost.getScriptSnapshot(fileName)! + const fileContent = scriptSnapshot.getText(0, scriptSnapshot.getLength()) + const lastChar = fileContent[position - 1] + if ( c('experiments.speedLinkedEditing') && + /[\w\d.-]/i.test(lastChar ?? '') && lastLinkedEditingRangeRequest && lastLinkedEditingRangeRequest.pos === position - 1 && lastLinkedEditingRangeRequest.fileName === fileName From 493c2c2cc88b2b36829222d4266cd8bdab0d1703 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Tue, 9 Jan 2024 05:57:14 +0530 Subject: [PATCH 2/8] fix(enableFileDefinitions): lookup from workspace root file even on relative path --- typescript/src/definitions.ts | 36 ++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/typescript/src/definitions.ts b/typescript/src/definitions.ts index 364010e..77ee68d 100644 --- a/typescript/src/definitions.ts +++ b/typescript/src/definitions.ts @@ -20,20 +20,34 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, }) } + const program = languageService.getProgram()! + const sourceFile = program.getSourceFile(fileName)! + const getNode = () => { + return findChildContainingExactPosition(sourceFile, position) + } + + const noDefs = !prior || !prior.definitions || prior.definitions.length === 0 + const tryFileResolve = noDefs || ['?', '#'].some(x => prior.definitions?.[0]?.fileName?.includes(x)) + // Definition fallbacks - if (!prior || prior.definitions?.length === 0) { - const program = languageService.getProgram()! - const sourceFile = program.getSourceFile(fileName)! - const node = findChildContainingExactPosition(sourceFile, position) + if (noDefs || tryFileResolve) { + const node = getNode() if (node && ts.isStringLiteral(node)) { const textSpanStart = node.pos + node.getLeadingTriviaWidth() + 1 // + 1 for quote const textSpan = { start: textSpanStart, length: node.end - textSpanStart - 1, } - if (c('enableFileDefinitions') && ['./', '../'].some(str => node.text.startsWith(str))) { - const file = join(fileName, '..', node.text) - if (languageServiceHost.fileExists?.(file)) { + + if (tryFileResolve && c('enableFileDefinitions') && ['./', '../'].some(str => node.text.startsWith(str))) { + const pathText = node.text.split('?')[0]!.split('#')[0]! + const fileCandidates = [ + join(fileName, '..', pathText), + // also try to resolve from root. Why? It might common in Node.js script paths that go from working directory (project root) + pathText.startsWith('./') ? join(languageServiceHost.getCurrentDirectory(), pathText) : (undefined as never), + ].filter(Boolean) + const resolvedFile = fileCandidates.find(file => languageServiceHost.fileExists?.(file)) + if (resolvedFile) { return { textSpan, definitions: [ @@ -41,7 +55,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, containerKind: undefined as any, containerName: '', name: '', - fileName: file, + fileName: resolvedFile, textSpan: { start: 0, length: 0 }, kind: ts.ScriptElementKind.moduleElement, contextSpan: { start: 0, length: 0 }, @@ -50,10 +64,9 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, } } } - // partial fix for https://github.com/microsoft/TypeScript/issues/49033 (string literal in function call definition) // thoughts about type definition: no impl here, will be simpler to do this in core instead - if (ts.isCallExpression(node.parent)) { + if (noDefs && ts.isCallExpression(node.parent)) { const parameterIndex = node.parent.arguments.indexOf(node) const typeChecker = program.getTypeChecker() const type = typeChecker.getContextualType(node.parent.expression) ?? typeChecker.getTypeAtLocation(node.parent.expression) @@ -108,7 +121,8 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, } } } - return prior + + if (noDefs) return prior } if (__WEB__) { From 74bde70a36f266c82cb591d7526ac36a1a013dab Mon Sep 17 00:00:00 2001 From: Vitaly Date: Tue, 16 Jan 2024 06:16:48 +0530 Subject: [PATCH 3/8] feat: Add new feature JSX Attribute Shortcut Completions! New completions like `className={className}`, enabled by default! control by `jsxAttributeShortcutCompletions.enable` --- package.json | 4 +- pnpm-lock.yaml | 138 ++++++++++---------- src/configurationType.ts | 7 + typescript/src/completions/jsxAttributes.ts | 88 ++++++++----- typescript/src/completionsAtPosition.ts | 2 +- typescript/src/decorateProxy.ts | 31 ++++- typescript/src/utils.ts | 21 ++- typescript/src/volarConfig.ts | 2 +- 8 files changed, 182 insertions(+), 111 deletions(-) diff --git a/package.json b/package.json index 1b3332a..8f52e6f 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,7 @@ "tsm": "^2.3.0", "type-fest": "^2.13.1", "typed-jsonfile": "^0.2.1", - "typescript": "5.1.6", + "typescript": "5.3.3", "vite": "^4.1.1", "vitest": "^0.34.6", "vitest-environment-ts-plugin": "./vitest-environment-ts-plugin", @@ -191,7 +191,7 @@ "require-from-string": "^2.0.2", "semver": "^7.3.8", "string-dedent": "^3.0.1", - "ts-expose-internals": "^4.9.3", + "ts-expose-internals": "^5.3.3", "ts-simple-type": "^1.0.7", "unleashed-typescript": "^1.3.0", "vscode-framework": "^0.0.18", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 435516b..9477b06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,13 +34,13 @@ importers: version: 2.1.5 '@vue/language-core': specifier: latest - version: 1.8.22(typescript@5.1.6) + version: 1.8.22(typescript@5.3.3) '@vue/language-server': specifier: latest - version: 1.8.22(typescript@5.1.6) + version: 1.8.22(typescript@5.3.3) '@vue/language-service': specifier: latest - version: 1.8.22(typescript@5.1.6) + version: 1.8.22(typescript@5.3.3) '@zardoy/utils': specifier: ^0.0.9 version: 0.0.9 @@ -70,7 +70,7 @@ importers: version: 8.7.0 eslint-config-zardoy: specifier: ^0.2.12 - version: 0.2.12(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.7.0)(typescript@5.1.6) + version: 0.2.12(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.7.0)(typescript@5.3.3) glob: specifier: ^8.0.3 version: 8.0.3 @@ -111,17 +111,17 @@ importers: specifier: ^3.0.1 version: 3.0.1 ts-expose-internals: - specifier: ^4.9.3 - version: 4.9.3 + specifier: ^5.3.3 + version: 5.3.3 ts-simple-type: specifier: ^1.0.7 version: 1.0.7 unleashed-typescript: specifier: ^1.3.0 - version: 1.3.0(typescript@5.1.6) + version: 1.3.0(typescript@5.3.3) vscode-framework: specifier: ^0.0.18 - version: 0.0.18(@types/vscode@1.72.0)(typescript@5.1.6) + version: 0.0.18(@types/vscode@1.72.0)(typescript@5.3.3) vscode-uri: specifier: ^3.0.6 version: 3.0.6 @@ -146,7 +146,7 @@ importers: version: 0.34.6(vitest@0.34.6) '@zardoy/tsconfig': specifier: ^1.3.1 - version: 1.3.1(typescript@5.1.6) + version: 1.3.1(typescript@5.3.3) esbuild: specifier: ^0.15.15 version: 0.15.18 @@ -172,8 +172,8 @@ importers: specifier: ^0.2.1 version: 0.2.1 typescript: - specifier: 5.1.6 - version: 5.1.6 + specifier: 5.3.3 + version: 5.3.3 vite: specifier: ^4.1.1 version: 4.1.1(@types/node@16.11.21) @@ -857,7 +857,7 @@ packages: dev: false optional: true - /@typescript-eslint/eslint-plugin@5.37.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0)(typescript@5.1.6): + /@typescript-eslint/eslint-plugin@5.37.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0)(typescript@5.3.3): resolution: {integrity: sha512-Fde6W0IafXktz1UlnhGkrrmnnGpAo1kyX7dnyHHVrmwJOn72Oqm3eYtddrpOwwel2W8PAK9F3pIL5S+lfoM0og==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -868,23 +868,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.3.3) '@typescript-eslint/scope-manager': 5.37.0 - '@typescript-eslint/type-utils': 5.37.0(eslint@8.7.0)(typescript@5.1.6) - '@typescript-eslint/utils': 5.37.0(eslint@8.7.0)(typescript@5.1.6) + '@typescript-eslint/type-utils': 5.37.0(eslint@8.7.0)(typescript@5.3.3) + '@typescript-eslint/utils': 5.37.0(eslint@8.7.0)(typescript@5.3.3) debug: 4.3.4(supports-color@8.1.1) eslint: 8.7.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.8 - tsutils: 3.21.0(typescript@5.1.6) - typescript: 5.1.6 + tsutils: 3.21.0(typescript@5.3.3) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/parser@5.37.0(eslint@8.7.0)(typescript@5.1.6): + /@typescript-eslint/parser@5.37.0(eslint@8.7.0)(typescript@5.3.3): resolution: {integrity: sha512-01VzI/ipYKuaG5PkE5+qyJ6m02fVALmMPY3Qq5BHflDx3y4VobbLdHQkSMg9VPRS4KdNt4oYTMaomFoHonBGAw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -896,10 +896,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.37.0 '@typescript-eslint/types': 5.37.0 - '@typescript-eslint/typescript-estree': 5.37.0(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 5.37.0(typescript@5.3.3) debug: 4.3.4(supports-color@8.1.1) eslint: 8.7.0 - typescript: 5.1.6 + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: false @@ -912,7 +912,7 @@ packages: '@typescript-eslint/visitor-keys': 5.37.0 dev: false - /@typescript-eslint/type-utils@5.37.0(eslint@8.7.0)(typescript@5.1.6): + /@typescript-eslint/type-utils@5.37.0(eslint@8.7.0)(typescript@5.3.3): resolution: {integrity: sha512-BSx/O0Z0SXOF5tY0bNTBcDEKz2Ec20GVYvq/H/XNKiUorUFilH7NPbFUuiiyzWaSdN3PA8JV0OvYx0gH/5aFAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -922,12 +922,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.37.0(typescript@5.1.6) - '@typescript-eslint/utils': 5.37.0(eslint@8.7.0)(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 5.37.0(typescript@5.3.3) + '@typescript-eslint/utils': 5.37.0(eslint@8.7.0)(typescript@5.3.3) debug: 4.3.4(supports-color@8.1.1) eslint: 8.7.0 - tsutils: 3.21.0(typescript@5.1.6) - typescript: 5.1.6 + tsutils: 3.21.0(typescript@5.3.3) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: false @@ -937,7 +937,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: false - /@typescript-eslint/typescript-estree@5.37.0(typescript@5.1.6): + /@typescript-eslint/typescript-estree@5.37.0(typescript@5.3.3): resolution: {integrity: sha512-JkFoFIt/cx59iqEDSgIGnQpCTRv96MQnXCYvJi7QhBC24uyuzbD8wVbajMB1b9x4I0octYFJ3OwjAwNqk1AjDA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -952,13 +952,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.8 - tsutils: 3.21.0(typescript@5.1.6) - typescript: 5.1.6 + tsutils: 3.21.0(typescript@5.3.3) + typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/utils@5.37.0(eslint@8.7.0)(typescript@5.1.6): + /@typescript-eslint/utils@5.37.0(eslint@8.7.0)(typescript@5.3.3): resolution: {integrity: sha512-jUEJoQrWbZhmikbcWSMDuUSxEE7ID2W/QCV/uz10WtQqfOuKZUqFGjqLJ+qhDd17rjgp+QJPqTdPIBWwoob2NQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -967,7 +967,7 @@ packages: '@types/json-schema': 7.0.9 '@typescript-eslint/scope-manager': 5.37.0 '@typescript-eslint/types': 5.37.0 - '@typescript-eslint/typescript-estree': 5.37.0(typescript@5.1.6) + '@typescript-eslint/typescript-estree': 5.37.0(typescript@5.3.3) eslint: 8.7.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0(eslint@8.7.0) @@ -1160,7 +1160,7 @@ packages: '@vue/shared': 3.3.4 dev: false - /@vue/language-core@1.8.22(typescript@5.1.6): + /@vue/language-core@1.8.22(typescript@5.3.3): resolution: {integrity: sha512-bsMoJzCrXZqGsxawtUea1cLjUT9dZnDsy5TuZ+l1fxRMzUGQUG9+Ypq4w//CqpWmrx7nIAJpw2JVF/t258miRw==} peerDependencies: typescript: '*' @@ -1175,33 +1175,33 @@ packages: computeds: 0.0.1 minimatch: 9.0.3 muggle-string: 0.3.1 - typescript: 5.1.6 + typescript: 5.3.3 vue-template-compiler: 2.7.14 dev: false - /@vue/language-server@1.8.22(typescript@5.1.6): + /@vue/language-server@1.8.22(typescript@5.3.3): resolution: {integrity: sha512-F1ogp9CgEOLPg2ydkDFHFBVBBgzzUYZMAef0/SO01NHEQeIoORtxXKdqgF8hzZlGjh3EqmliogeFCBOULiYuTg==} hasBin: true dependencies: '@volar/language-core': 1.10.10 '@volar/language-server': 1.10.10 '@volar/typescript': 1.10.10 - '@vue/language-core': 1.8.22(typescript@5.1.6) - '@vue/language-service': 1.8.22(typescript@5.1.6) + '@vue/language-core': 1.8.22(typescript@5.3.3) + '@vue/language-service': 1.8.22(typescript@5.3.3) vscode-languageserver-protocol: 3.17.5 - vue-component-meta: 1.8.22(typescript@5.1.6) + vue-component-meta: 1.8.22(typescript@5.3.3) transitivePeerDependencies: - typescript dev: false - /@vue/language-service@1.8.22(typescript@5.1.6): + /@vue/language-service@1.8.22(typescript@5.3.3): resolution: {integrity: sha512-N2VjxOfkTVzSC2PdPq52bZXAtmL+tSEpALtEkFCxv7YA1XeieMvUv1bn7K7P6CoNhakTMdi2ouEyBg9Lc1A+WQ==} dependencies: '@volar/language-core': 1.10.10 '@volar/language-service': 1.10.10 '@volar/typescript': 1.10.10 '@vue/compiler-dom': 3.3.4 - '@vue/language-core': 1.8.22(typescript@5.1.6) + '@vue/language-core': 1.8.22(typescript@5.3.3) '@vue/shared': 3.3.4 computeds: 0.0.1 volar-service-css: 0.0.15(@volar/language-service@1.10.10) @@ -1226,13 +1226,13 @@ packages: resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} dev: true - /@zardoy/tsconfig@1.3.1(typescript@5.1.6): + /@zardoy/tsconfig@1.3.1(typescript@5.3.3): resolution: {integrity: sha512-maEmpfUbcj29RFjs8tatq7P7Ev+W2F7Ppc02mpWYA9LDa+P0mKa+fa4YcrhL1ZeY/wWCUULCOoq2WuxSwu1pyw==} engines: {node: '>=14'} peerDependencies: typescript: ^4.5.4 dependencies: - typescript: 5.1.6 + typescript: 5.3.3 dev: true /@zardoy/utils@0.0.4: @@ -1287,7 +1287,7 @@ packages: type-fest: 2.19.0 typed-jsonfile: 0.2.1 untildify: 4.0.0 - vscode-framework: 0.0.18(@types/vscode@1.72.0)(typescript@5.1.6) + vscode-framework: 0.0.18(@types/vscode@1.72.0)(typescript@5.3.3) vscode-manifest: 0.0.8 vscode-uri: 3.0.6 dev: false @@ -2694,7 +2694,7 @@ packages: eslint-plugin-react-hooks: 4.6.0(eslint@8.7.0) dev: false - /eslint-config-xo-typescript@0.47.1(@typescript-eslint/eslint-plugin@5.37.0)(eslint@8.7.0)(typescript@5.1.6): + /eslint-config-xo-typescript@0.47.1(@typescript-eslint/eslint-plugin@5.37.0)(eslint@8.7.0)(typescript@5.3.3): resolution: {integrity: sha512-BkbzIltZCWp8QLekKJKG8zJ/ZGezD8Z9FaJ+hJ5PrAVUGkIPmxXLLEHCKS3ax7oOqZLYQiG+jyKfQDIEdTQgbg==} engines: {node: '>=12'} peerDependencies: @@ -2702,9 +2702,9 @@ packages: eslint: '>=8.0.0' typescript: '>=4.4' dependencies: - '@typescript-eslint/eslint-plugin': 5.37.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0)(typescript@5.1.6) + '@typescript-eslint/eslint-plugin': 5.37.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0)(typescript@5.3.3) eslint: 8.7.0 - typescript: 5.1.6 + typescript: 5.3.3 dev: false /eslint-config-xo@0.39.0(eslint@8.7.0): @@ -2717,7 +2717,7 @@ packages: eslint: 8.7.0 dev: false - /eslint-config-zardoy@0.2.12(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.7.0)(typescript@5.1.6): + /eslint-config-zardoy@0.2.12(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.7.0)(typescript@5.3.3): resolution: {integrity: sha512-zFgNruQu/0O83U8q5v8GRj1sTLWGEc2ITO4ATWOXo0zZXOY3YSsyxggUAxrYWTlWIHsKNyCFRtJ4TUaglXjnyw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: @@ -2738,13 +2738,13 @@ packages: optional: true dependencies: '@rushstack/eslint-patch': 1.2.0 - '@typescript-eslint/eslint-plugin': 5.37.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0)(typescript@5.1.6) - '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.1.6) + '@typescript-eslint/eslint-plugin': 5.37.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0)(typescript@5.3.3) + '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.3.3) eslint: 8.7.0 eslint-config-prettier: 8.5.0(eslint@8.7.0) eslint-config-xo: 0.39.0(eslint@8.7.0) eslint-config-xo-react: 0.25.0(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.7.0) - eslint-config-xo-typescript: 0.47.1(@typescript-eslint/eslint-plugin@5.37.0)(eslint@8.7.0)(typescript@5.1.6) + eslint-config-xo-typescript: 0.47.1(@typescript-eslint/eslint-plugin@5.37.0)(eslint@8.7.0)(typescript@5.3.3) eslint-plugin-eslint-comments: 3.2.0(eslint@8.7.0) eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0) eslint-plugin-node: 11.1.0(eslint@8.7.0) @@ -2752,7 +2752,7 @@ packages: eslint-plugin-react-hooks: 4.6.0(eslint@8.7.0) eslint-plugin-sonarjs: 0.11.0(eslint@8.7.0) eslint-plugin-unicorn: 39.0.0(eslint@8.7.0) - typescript: 5.1.6 + typescript: 5.3.3 transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -2789,7 +2789,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.7.0 eslint-import-resolver-node: 0.3.6 @@ -2829,7 +2829,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.1.6) + '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.3.3) array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 @@ -3343,7 +3343,7 @@ packages: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: false - /generated-module@0.0.2(typescript@5.1.6): + /generated-module@0.0.2(typescript@5.3.3): resolution: {integrity: sha512-7lYkwjKP3ymFvDZh4hGcALdFGyf/vZbHZNR/8qrY/FVTUBja/bMA2OzVq8HneMuKi9UFdgXBLXVDjdvdZxGLVg==} peerDependencies: typescript: ^4.4.3 @@ -3355,7 +3355,7 @@ packages: fs-extra: 10.1.0 jsonfile: 6.1.0 ts-morph: 12.2.0 - typescript: 5.1.6 + typescript: 5.3.3 dev: false /gensync@1.0.0-beta.2: @@ -5916,8 +5916,8 @@ packages: resolution: {integrity: sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==} dev: false - /ts-expose-internals@4.9.3: - resolution: {integrity: sha512-UoJaBLpLKMIQBdYhLyZtFaYbQ10sZhTqhXDU/VXhUk50xcmeTuJXqnU/ZQ5bdkLeXuPLS/6KKsQspTETV1zfRg==} + /ts-expose-internals@5.3.3: + resolution: {integrity: sha512-0lW96u0pa08dq9QLYUBRbgGkvsD+LvPAVGe94kr2tHaRZAxgckwJ+qqc1BSRoR1rpkTZf7AWAa6DKrLGFmctwg==} dev: false /ts-morph@12.2.0: @@ -5990,14 +5990,14 @@ packages: engines: {node: '>=0.6.x'} dev: false - /tsutils@3.21.0(typescript@5.1.6): + /tsutils@3.21.0(typescript@5.3.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} 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' dependencies: tslib: 1.14.1 - typescript: 5.1.6 + typescript: 5.3.3 dev: false /type-check@0.3.2: @@ -6082,7 +6082,7 @@ packages: jsonfile: 6.1.0 type-fest: 2.13.1 - /typed-vscode@0.0.5(@types/vscode@1.72.0)(typescript@5.1.6): + /typed-vscode@0.0.5(@types/vscode@1.72.0)(typescript@5.3.3): resolution: {integrity: sha512-BJpELW+Q35iWc6t/Na0ZGprG1jwGgFb3U+71UIDKjxEp+LZZKatMzoBSuPoO/saTeSzMY8YinGsglkgru8u9jg==} engines: {node: ^14.13.1 || >=16.0.0} hasBin: true @@ -6095,7 +6095,7 @@ packages: commander: 8.3.0 cosmiconfig: 7.0.1 fs-extra: 10.1.0 - generated-module: 0.0.2(typescript@5.1.6) + generated-module: 0.0.2(typescript@5.3.3) lodash: 4.17.21 quicktype-core: 6.0.70 type-fest: 2.13.1 @@ -6139,8 +6139,8 @@ packages: hasBin: true dev: false - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + /typescript@5.3.3: + resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} engines: {node: '>=14.17'} hasBin: true @@ -6175,7 +6175,7 @@ packages: resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} engines: {node: '>= 10.0.0'} - /unleashed-typescript@1.3.0(typescript@5.1.6): + /unleashed-typescript@1.3.0(typescript@5.3.3): resolution: {integrity: sha512-ORMwdtBlEQTD4Dl+HkPVfwnIG5wKBqQn72INfCHGN8dgZ3AFKwv1m7a4tL1JEGLwCUzFVH3sq/nDxPjDmvlWwg==} engines: {node: '>=12', pnpm: '>=6'} hasBin: true @@ -6183,7 +6183,7 @@ packages: peerDependencies: typescript: '*' dependencies: - typescript: 5.1.6 + typescript: 5.3.3 dev: false /untildify@4.0.0: @@ -6542,7 +6542,7 @@ packages: lodash: 4.17.21 dev: false - /vscode-framework@0.0.18(@types/vscode@1.72.0)(typescript@5.1.6): + /vscode-framework@0.0.18(@types/vscode@1.72.0)(typescript@5.3.3): resolution: {integrity: sha512-9Vp/KVboUFtEGc7vKNXQb5YK1B27JBeZ67U+Yi5aH9ZvtM9fERydbL+n2p+GS2oGf9x3pyT2bEfF3j/sXojHig==} engines: {node: ^14.13.1 || >=16.0.0} hasBin: true @@ -6565,7 +6565,7 @@ packages: exit-hook: 2.2.1 filesize: 8.0.7 fs-extra: 10.1.0 - generated-module: 0.0.2(typescript@5.1.6) + generated-module: 0.0.2(typescript@5.3.3) github-remote-info: 1.0.3 globby: 11.1.0 jsonfile: 6.1.0 @@ -6575,7 +6575,7 @@ packages: pkg-dir: 5.0.0 pretty-format: 27.4.6 typed-jsonfile: 0.2.1 - typed-vscode: 0.0.5(@types/vscode@1.72.0)(typescript@5.1.6) + typed-vscode: 0.0.5(@types/vscode@1.72.0)(typescript@5.3.3) typescript-json-schema: 0.51.0 vscode-extra: 0.0.4(@types/vscode@1.72.0) vscode-manifest: 0.0.8 @@ -6683,7 +6683,7 @@ packages: resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} dev: false - /vue-component-meta@1.8.22(typescript@5.1.6): + /vue-component-meta@1.8.22(typescript@5.3.3): resolution: {integrity: sha512-xic335E3KOm3uMcg23UDqo0y1XII8PVPjwoIkzi3tjUzP0edM3m9jF8SYevnJLp1NqiZ035iG1N6QMEauSAulA==} peerDependencies: typescript: '*' @@ -6692,9 +6692,9 @@ packages: optional: true dependencies: '@volar/typescript': 1.10.10 - '@vue/language-core': 1.8.22(typescript@5.1.6) + '@vue/language-core': 1.8.22(typescript@5.3.3) typesafe-path: 0.2.2 - typescript: 5.1.6 + typescript: 5.3.3 vue-component-type-helpers: 1.8.22 dev: false diff --git a/src/configurationType.ts b/src/configurationType.ts index 73981b7..5101642 100644 --- a/src/configurationType.ts +++ b/src/configurationType.ts @@ -564,6 +564,13 @@ export type Configuration = { * @default before */ 'objectLiteralCompletions.keepOriginal': 'before' | 'after' | 'remove' + /** + * Add shortcut completions like `className` -> `class={className}` if there is the variable with the same name in scope available + * - after - display shortcut after original suggestion + * - before - display shortcut before original suggestion + * @default after + */ + 'jsxAttributeShortcutCompletions.enable': 'disable' | 'before' | 'after' /** * Wether to exclude non-JSX components completions in JSX component locations * Requires TypeScript 5.0+ diff --git a/typescript/src/completions/jsxAttributes.ts b/typescript/src/completions/jsxAttributes.ts index b4e4a7e..66bb306 100644 --- a/typescript/src/completions/jsxAttributes.ts +++ b/typescript/src/completions/jsxAttributes.ts @@ -1,6 +1,8 @@ import { compact } from '@zardoy/utils' import escapeStringRegexp from 'escape-string-regexp' import { Configuration } from '../../../src/configurationType' +import { collectLocalSymbols } from '../utils' +import { sharedCompletionContext } from './sharedContext' export default ( entries: ts.CompletionEntry[], @@ -35,41 +37,65 @@ export default ( jsxAttributeCandidate = true node = node.parent } - if (jsxAttributeCandidate && Object.keys(jsxCompletionsMap).length > 0 && (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node))) { - const tagName = node.tagName.getText() - // TODO use the same perf optimization for replaceSuggestions - const patchEntries: Record = {} - for (const [key, patchMethod] of Object.entries(jsxCompletionsMap)) { - const splitTagNameIdx = key.indexOf('#') - if (splitTagNameIdx === -1) continue - const comparingTagName = key.slice(0, splitTagNameIdx) - if (comparingTagName && comparingTagName !== tagName) continue - const comparingName = key.slice(splitTagNameIdx + 1) - if (comparingName.includes('*')) { - const regexMatch = new RegExp(`^${escapeStringRegexp(comparingName).replaceAll('\\*', '.*')}$`) - for (const [index, { name, kind }] of entries.entries()) { - if (kind === ts.ScriptElementKind.memberVariableElement && regexMatch.test(name)) { - patchEntries[index] = patchMethod + if (jsxAttributeCandidate) { + if ( + sharedCompletionContext.c('improveJsxCompletions') && + Object.keys(jsxCompletionsMap).length > 0 && + (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) + ) { + const tagName = node.tagName.getText() + // TODO use the same perf optimization for replaceSuggestions + const patchEntries: Record = {} + for (const [key, patchMethod] of Object.entries(jsxCompletionsMap)) { + const splitTagNameIdx = key.indexOf('#') + if (splitTagNameIdx === -1) continue + const comparingTagName = key.slice(0, splitTagNameIdx) + if (comparingTagName && comparingTagName !== tagName) continue + const comparingName = key.slice(splitTagNameIdx + 1) + if (comparingName.includes('*')) { + const regexMatch = new RegExp(`^${escapeStringRegexp(comparingName).replaceAll('\\*', '.*')}$`) + for (const [index, { name, kind }] of entries.entries()) { + if (kind === ts.ScriptElementKind.memberVariableElement && regexMatch.test(name)) { + patchEntries[index] = patchMethod + } } + } else { + // I think it needs some sort of optimization by using wordRange + const indexToPatch = entries.findIndex(({ name, kind }) => kind === ts.ScriptElementKind.memberVariableElement && name === comparingName) + if (indexToPatch === -1) continue + patchEntries[indexToPatch] = patchMethod } - } else { - // I think it needs some sort of optimization by using wordRange - const indexToPatch = entries.findIndex(({ name, kind }) => kind === ts.ScriptElementKind.memberVariableElement && name === comparingName) - if (indexToPatch === -1) continue - patchEntries[indexToPatch] = patchMethod } + entries = compact( + entries.flatMap((entry, i) => { + const patchMethod = patchEntries[i] + if (patchMethod === undefined) return entry + if (patchMethod === false) return + const patchedEntry: ts.CompletionEntry = { ...entry, insertText: entry.name + patchMethod.insertText, isSnippet: true } + const { keepOriginal } = patchMethod + if (!keepOriginal) return patchedEntry + return keepOriginal === 'above' ? [entry, patchedEntry] : [patchedEntry, entry] + }), + ) + } + + const enableJsxAttributesShortcuts = sharedCompletionContext.c('jsxAttributeShortcutCompletions.enable') + if (enableJsxAttributesShortcuts !== 'disable') { + const locals = collectLocalSymbols(node, sharedCompletionContext.typeChecker) + entries = entries.flatMap(entry => { + if (locals.includes(entry.name)) { + const insertText = entry.name + `={${entry.name}}` + const additionalSuggestions = { + ...entry, + name: insertText, + insertText: insertText, + } + return enableJsxAttributesShortcuts === 'after' ? [entry, additionalSuggestions] : [additionalSuggestions, entry] + } + return entry + }) } - entries = compact( - entries.flatMap((entry, i) => { - const patchMethod = patchEntries[i] - if (patchMethod === undefined) return entry - if (patchMethod === false) return - const patchedEntry: ts.CompletionEntry = { ...entry, insertText: entry.name + patchMethod.insertText, isSnippet: true } - const { keepOriginal } = patchMethod - if (!keepOriginal) return patchedEntry - return keepOriginal === 'above' ? [entry, patchedEntry] : [patchedEntry, entry] - }), - ) } + return entries } diff --git a/typescript/src/completionsAtPosition.ts b/typescript/src/completionsAtPosition.ts index fc6d53d..746acbe 100644 --- a/typescript/src/completionsAtPosition.ts +++ b/typescript/src/completionsAtPosition.ts @@ -297,7 +297,7 @@ export const getCompletionsAtPosition = ( addSourceDefinition(prior.entries) displayImportedInfo(prior.entries) - if (c('improveJsxCompletions') && leftNode) prior.entries = improveJsxCompletions(prior.entries, leftNode, position, sourceFile, c('jsxCompletionsMap')) + if (leftNode) prior.entries = improveJsxCompletions(prior.entries, leftNode, position, sourceFile, c('jsxCompletionsMap')) prior.entries = localityBonus(prior.entries) ?? prior.entries typecastCompletions() diff --git a/typescript/src/decorateProxy.ts b/typescript/src/decorateProxy.ts index 6886ae7..0232e82 100644 --- a/typescript/src/decorateProxy.ts +++ b/typescript/src/decorateProxy.ts @@ -82,11 +82,32 @@ export const decorateLanguageService = ( // have no idea in which cases its possible, but we can't work without it if (!scriptSnapshot) return const compilerOptions = languageServiceHost.getCompilationSettings() - const result = getCompletionsAtPosition(fileName, position, options, c, languageService, scriptSnapshot, formatOptions, { scriptKind, compilerOptions }) - if (!result) return - prevCompletionsMap = result.prevCompletionsMap - prevCompletionsAdditionalData = result.prevCompletionsAdditionalData - return result.completions + try { + const result = getCompletionsAtPosition(fileName, position, options, c, languageService, scriptSnapshot, formatOptions, { + scriptKind, + compilerOptions, + }) + if (!result) return + prevCompletionsMap = result.prevCompletionsMap + prevCompletionsAdditionalData = result.prevCompletionsAdditionalData + return result.completions + } catch (err) { + setTimeout(() => { + throw err + }) + return { + entries: [ + { + name: 'TS Error', + kind: ts.ScriptElementKind.unknown, + labelDetails: { + detail: ` ${err.message}`, + }, + sortText: '!', + }, + ], + } + } } proxy.getCompletionEntryDetails = (...inputArgs) => completionEntryDetails(inputArgs, languageService, prevCompletionsMap, c, prevCompletionsAdditionalData) diff --git a/typescript/src/utils.ts b/typescript/src/utils.ts index 4c7ad77..11c5097 100644 --- a/typescript/src/utils.ts +++ b/typescript/src/utils.ts @@ -375,16 +375,33 @@ export const isNameUniqueAtLocation = (name: string, location: ts.Node | undefin } return !hasCollision } -export const isNameUniqueAtNodeClosestScope = (name: string, node: ts.Node, typeChecker: ts.TypeChecker) => { - const closestScope = findClosestParent( +const getClosestParentScope = (node: ts.Node) => { + return findClosestParent( node, [ts.SyntaxKind.Block, ts.SyntaxKind.FunctionDeclaration, ts.SyntaxKind.FunctionExpression, ts.SyntaxKind.ArrowFunction, ts.SyntaxKind.SourceFile], [], false, ) +} +export const isNameUniqueAtNodeClosestScope = (name: string, node: ts.Node, typeChecker: ts.TypeChecker) => { + const closestScope = getClosestParentScope(node) return isNameUniqueAtLocation(name, closestScope, typeChecker) } +export const collectLocalSymbols = (location: ts.Node, typeChecker: ts.TypeChecker) => { + const symbolNames = new Set() + while (location) { + const symbols = (location as unknown as import('typescript-full').LocalsContainer).locals + if (symbols) { + for (const symbol of symbols.keys()) { + symbolNames.add(symbol as string) + } + } + location = location.parent + } + return [...symbolNames] +} + const createUniqueName = (name: string, sourceFile: ts.SourceFile) => { /** * A free identifier is an identifier that can be accessed through name lookup as a local variable. diff --git a/typescript/src/volarConfig.ts b/typescript/src/volarConfig.ts index 94a141f..7bc279a 100644 --- a/typescript/src/volarConfig.ts +++ b/typescript/src/volarConfig.ts @@ -14,7 +14,7 @@ const plugin: (...args: Parameters) => return } if (!tsModule) throw new Error('typescript module is missing!') - await new Promise(resolve => { + await new Promise(resolve => { if (context.services.typescript) { resolve() } else { From 08caa2a881b232aab0a3ed492844bf85ad0b932e Mon Sep 17 00:00:00 2001 From: Vitaly Date: Tue, 16 Jan 2024 18:21:44 +0530 Subject: [PATCH 4/8] linter update in the project --- .eslintignore | 1 + .eslintrc.json | 6 +- package.json | 6 +- pnpm-lock.yaml | 1046 ++++++----------- src/apiCommands.ts | 2 +- src/extension.ts | 2 +- src/sendCommand.ts | 1 - src/specialCommands.ts | 2 +- src/vueVolarSupport.ts | 5 +- typescript/src/adjustAutoImports.ts | 2 +- .../custom/renameParameterToNameFromType.ts | 1 - typescript/src/codeFixes.ts | 32 +- typescript/src/codeFixes/codeFixInterface.ts | 2 +- typescript/src/completions/arrayMethods.ts | 1 - .../src/completions/filterJsxComponents.ts | 5 +- typescript/src/completions/jsxAttributes.ts | 4 +- .../completions/objectLiteralCompletions.ts | 2 +- .../src/completions/stringTemplateType.ts | 2 +- typescript/src/completionsAtPosition.ts | 7 +- typescript/src/decorateEditsForFileRename.ts | 2 +- typescript/src/decorateFormatFeatures.ts | 2 +- typescript/src/decorateProxy.ts | 2 +- typescript/src/definitions.ts | 10 +- typescript/src/dummyLanguageService.ts | 4 +- typescript/src/getPatchedNavTree.ts | 22 +- typescript/src/references.ts | 14 +- typescript/src/specialCommands/handle.ts | 2 +- typescript/src/utils.ts | 4 +- typescript/src/volarConfig.ts | 2 +- 29 files changed, 458 insertions(+), 735 deletions(-) diff --git a/.eslintignore b/.eslintignore index a067add..1361a3d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ +src/generated.ts src/configurationType.ts src/configurationTypeCache.jsonc playground.ts diff --git a/.eslintrc.json b/.eslintrc.json index 78e9aa6..acf9be1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -29,7 +29,11 @@ } ] } - ] + ], + "unicorn/switch-case-braces": "off", + "@typescript-eslint/consistent-type-imports": "off", + "@typescript-eslint/ban-types": "off", + "sonarjs/prefer-single-boolean-return": "off" }, "overrides": [ { diff --git a/package.json b/package.json index 8f52e6f..84fbaec 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "watch-plugin": "node buildTsPlugin.mjs --watch", "build": "tsc && tsc -p typescript --noEmit && vscode-framework build && pnpm build-plugin", "build-plugin": "node buildTsPlugin.mjs && node buildTsPlugin.mjs --browser", - "lint": "eslint {src/**,typescript/src/**}", + "lint": "eslint {src,typescript/src}", "test": "pnpm test-plugin --run && pnpm integration-test", "test-plugin": "vitest --globals --dir typescript/test/ --environment ts-plugin", "integration-test": "node integration/prerun.mjs && tsc -p tsconfig.test.json && node testsOut/runTests.js", @@ -176,8 +176,8 @@ "chokidar-cli": "^3.0.0", "delay": "^5.0.0", "escape-string-regexp": "^5.0.0", - "eslint": "^8.7.0", - "eslint-config-zardoy": "^0.2.12", + "eslint": "^8.56.0", + "eslint-config-zardoy": "^0.2.17", "glob": "^8.0.3", "lodash": "^4.17.21", "lodash.get": "^4.4.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9477b06..39c742e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -66,11 +66,11 @@ importers: specifier: ^5.0.0 version: 5.0.0 eslint: - specifier: ^8.7.0 - version: 8.7.0 + specifier: ^8.56.0 + version: 8.56.0 eslint-config-zardoy: - specifier: ^0.2.12 - version: 0.2.12(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.7.0)(typescript@5.3.3) + specifier: ^0.2.17 + version: 0.2.17(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.56.0)(typescript@5.3.3) glob: specifier: ^8.0.3 version: 8.0.3 @@ -191,12 +191,9 @@ importers: packages: - /@ampproject/remapping@2.2.0: - resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} - engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/gen-mapping': 0.1.1 - '@jridgewell/trace-mapping': 0.3.15 + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} dev: false /@babel/code-frame@7.16.7: @@ -206,139 +203,6 @@ packages: '@babel/highlight': 7.16.10 dev: false - /@babel/code-frame@7.18.6: - resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/highlight': 7.18.6 - dev: false - - /@babel/compat-data@7.19.1: - resolution: {integrity: sha512-72a9ghR0gnESIa7jBN53U32FOVCEoztyIlKaNoU05zRhEecduGK9L9c3ww7Mp06JiR+0ls0GBPFJQwwtjn9ksg==} - engines: {node: '>=6.9.0'} - dev: false - - /@babel/core@7.19.1: - resolution: {integrity: sha512-1H8VgqXme4UXCRv7/Wa1bq7RVymKOzC7znjyFM8KiEzwFqcKUKYNoQef4GhdklgNvoBXyW4gYhuBNCM5o1zImw==} - engines: {node: '>=6.9.0'} - dependencies: - '@ampproject/remapping': 2.2.0 - '@babel/code-frame': 7.18.6 - '@babel/generator': 7.19.0 - '@babel/helper-compilation-targets': 7.19.1(@babel/core@7.19.1) - '@babel/helper-module-transforms': 7.19.0 - '@babel/helpers': 7.19.0 - '@babel/parser': 7.19.1 - '@babel/template': 7.18.10 - '@babel/traverse': 7.19.1 - '@babel/types': 7.19.0 - convert-source-map: 1.8.0 - debug: 4.3.4(supports-color@8.1.1) - gensync: 1.0.0-beta.2 - json5: 2.2.1 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/eslint-parser@7.19.1(@babel/core@7.19.1)(eslint@8.7.0): - resolution: {integrity: sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ==} - engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} - peerDependencies: - '@babel/core': '>=7.11.0' - eslint: ^7.5.0 || ^8.0.0 - dependencies: - '@babel/core': 7.19.1 - '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 - eslint: 8.7.0 - eslint-visitor-keys: 2.1.0 - semver: 6.3.0 - dev: false - - /@babel/generator@7.19.0: - resolution: {integrity: sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.0 - '@jridgewell/gen-mapping': 0.3.2 - jsesc: 2.5.2 - dev: false - - /@babel/helper-compilation-targets@7.19.1(@babel/core@7.19.1): - resolution: {integrity: sha512-LlLkkqhCMyz2lkQPvJNdIYU7O5YjWRgC2R4omjCTpZd8u8KMQzZvX4qce+/BluN1rcQiV7BoGUpmQ0LeHerbhg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/compat-data': 7.19.1 - '@babel/core': 7.19.1 - '@babel/helper-validator-option': 7.18.6 - browserslist: 4.21.4 - semver: 6.3.0 - dev: false - - /@babel/helper-environment-visitor@7.18.9: - resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} - engines: {node: '>=6.9.0'} - dev: false - - /@babel/helper-function-name@7.19.0: - resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.18.10 - '@babel/types': 7.19.0 - dev: false - - /@babel/helper-hoist-variables@7.18.6: - resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.0 - dev: false - - /@babel/helper-module-imports@7.18.6: - resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.0 - dev: false - - /@babel/helper-module-transforms@7.19.0: - resolution: {integrity: sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-simple-access': 7.18.6 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.19.1 - '@babel/template': 7.18.10 - '@babel/traverse': 7.19.1 - '@babel/types': 7.19.0 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/helper-simple-access@7.18.6: - resolution: {integrity: sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.0 - dev: false - - /@babel/helper-split-export-declaration@7.18.6: - resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.19.0 - dev: false - - /@babel/helper-string-parser@7.18.10: - resolution: {integrity: sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==} - engines: {node: '>=6.9.0'} - dev: false - /@babel/helper-string-parser@7.22.5: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} @@ -354,22 +218,6 @@ packages: engines: {node: '>=6.9.0'} dev: false - /@babel/helper-validator-option@7.18.6: - resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} - engines: {node: '>=6.9.0'} - dev: false - - /@babel/helpers@7.19.0: - resolution: {integrity: sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/template': 7.18.10 - '@babel/traverse': 7.19.1 - '@babel/types': 7.19.0 - transitivePeerDependencies: - - supports-color - dev: false - /@babel/highlight@7.16.10: resolution: {integrity: sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==} engines: {node: '>=6.9.0'} @@ -379,22 +227,6 @@ packages: js-tokens: 4.0.0 dev: false - /@babel/highlight@7.18.6: - resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-validator-identifier': 7.19.1 - chalk: 2.4.2 - js-tokens: 4.0.0 - dev: false - - /@babel/parser@7.19.1: - resolution: {integrity: sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A==} - engines: {node: '>=6.0.0'} - dependencies: - '@babel/types': 7.19.0 - dev: false - /@babel/parser@7.22.7: resolution: {integrity: sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==} engines: {node: '>=6.0.0'} @@ -403,42 +235,6 @@ packages: '@babel/types': 7.22.5 dev: false - /@babel/template@7.18.10: - resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.18.6 - '@babel/parser': 7.19.1 - '@babel/types': 7.19.0 - dev: false - - /@babel/traverse@7.19.1: - resolution: {integrity: sha512-0j/ZfZMxKukDaag2PtOPDbwuELqIar6lLskVPPJDjXMXjfLb1Obo/1yjxIGqqAJrmfaTIY3z2wFLAQ7qSkLsuA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/code-frame': 7.18.6 - '@babel/generator': 7.19.0 - '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.19.0 - '@babel/helper-hoist-variables': 7.18.6 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.19.1 - '@babel/types': 7.19.0 - debug: 4.3.4(supports-color@8.1.1) - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/types@7.19.0: - resolution: {integrity: sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-string-parser': 7.18.10 - '@babel/helper-validator-identifier': 7.19.1 - to-fast-properties: 2.0.0 - dev: false - /@babel/types@7.22.5: resolution: {integrity: sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==} engines: {node: '>=6.9.0'} @@ -508,15 +304,30 @@ packages: requiresBuild: true optional: true - /@eslint/eslintrc@1.0.5: - resolution: {integrity: sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==} + /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0): + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.56.0 + eslint-visitor-keys: 3.4.3 + dev: false + + /@eslint-community/regexpp@4.10.0: + resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dev: false + + /@eslint/eslintrc@2.1.4: + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4(supports-color@8.1.1) - espree: 9.3.0 - globals: 13.12.0 - ignore: 4.0.6 + espree: 9.6.1 + globals: 13.24.0 + ignore: 5.3.0 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 @@ -525,19 +336,29 @@ packages: - supports-color dev: false - /@humanwhocodes/config-array@0.9.2: - resolution: {integrity: sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==} + /@eslint/js@8.56.0: + resolution: {integrity: sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /@humanwhocodes/config-array@0.11.14: + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} dependencies: - '@humanwhocodes/object-schema': 1.2.1 + '@humanwhocodes/object-schema': 2.0.2 debug: 4.3.4(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color dev: false - /@humanwhocodes/object-schema@1.2.1: - resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} + /@humanwhocodes/module-importer@1.0.1: + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + dev: false + + /@humanwhocodes/object-schema@2.0.2: + resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} dev: false /@jest/schemas@29.6.3: @@ -551,48 +372,10 @@ packages: resolution: {integrity: sha512-qqNS/YD0Nck5wtQLCPHAfGVgWbbGafxSPjNh0ekYPFSNNqnDH2kamnduzYly8IiADmeVx/MfAE1njMEjVeHTMA==} dev: false - /@jridgewell/gen-mapping@0.1.1: - resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} - engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.14 - dev: false - - /@jridgewell/gen-mapping@0.3.2: - resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} - engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.14 - '@jridgewell/trace-mapping': 0.3.15 - dev: false - - /@jridgewell/resolve-uri@3.1.0: - resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} - engines: {node: '>=6.0.0'} - dev: false - - /@jridgewell/set-array@1.1.2: - resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} - engines: {node: '>=6.0.0'} - dev: false - - /@jridgewell/sourcemap-codec@1.4.14: - resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} - dev: false - /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping@0.3.15: - resolution: {integrity: sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==} - dependencies: - '@jridgewell/resolve-uri': 3.1.0 - '@jridgewell/sourcemap-codec': 1.4.14 - dev: false - /@koa/router@10.1.1: resolution: {integrity: sha512-ORNjq5z4EmQPriKbR0ER3k4Gh7YGNhWDL7JBW+8wXDrHLbWYKYSJaOJ9aN06npF5tbTxe2JBOsurpJDAvjiXKw==} engines: {node: '>= 8.0.0'} @@ -634,12 +417,6 @@ packages: tmp: 0.2.1 dev: true - /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: - resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} - dependencies: - eslint-scope: 5.1.1 - dev: false - /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -670,8 +447,8 @@ packages: strip-ansi: 6.0.1 dev: false - /@rushstack/eslint-patch@1.2.0: - resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} + /@rushstack/eslint-patch@1.6.1: + resolution: {integrity: sha512-UY+FGM/2jjMkzQLn8pxcHGMaVLh9aEitG3zY2CiY7XHdLiz3bZOwa6oDxNqEMv7zZkV+cj5DOdz0cQ1BP5Hjgw==} dev: false /@sinclair/typebox@0.27.8: @@ -782,6 +559,10 @@ packages: resolution: {integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==} dev: true + /@types/json-schema@7.0.15: + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + dev: false + /@types/json-schema@7.0.9: resolution: {integrity: sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==} dev: false @@ -846,6 +627,10 @@ packages: resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} dev: true + /@types/semver@7.5.6: + resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} + dev: false + /@types/vscode@1.72.0: resolution: {integrity: sha512-WvHluhUo+lQvE3I4wUagRpnkHuysB4qSyOQUyIAS9n9PYMJjepzTUD8Jyks0YeXoPD0UGctjqp2u84/b3v6Ydw==} @@ -857,137 +642,189 @@ packages: dev: false optional: true - /@typescript-eslint/eslint-plugin@5.37.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0)(typescript@5.3.3): - resolution: {integrity: sha512-Fde6W0IafXktz1UlnhGkrrmnnGpAo1kyX7dnyHHVrmwJOn72Oqm3eYtddrpOwwel2W8PAK9F3pIL5S+lfoM0og==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/eslint-plugin@6.1.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-qg7Bm5TyP/I7iilGyp6DRqqkt8na00lI6HbjWZObgk3FFSzH5ypRwAHXJhJkwiRtTcfn+xYQIMOR5kJgpo6upw==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 5.37.0 - '@typescript-eslint/type-utils': 5.37.0(eslint@8.7.0)(typescript@5.3.3) - '@typescript-eslint/utils': 5.37.0(eslint@8.7.0)(typescript@5.3.3) + '@eslint-community/regexpp': 4.10.0 + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.1.0 + '@typescript-eslint/type-utils': 6.1.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.1.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.1.0 debug: 4.3.4(supports-color@8.1.1) - eslint: 8.7.0 - functional-red-black-tree: 1.0.1 - ignore: 5.2.0 - regexpp: 3.2.0 - semver: 7.3.8 - tsutils: 3.21.0(typescript@5.3.3) + eslint: 8.56.0 + graphemer: 1.4.0 + ignore: 5.3.0 + natural-compare: 1.4.0 + natural-compare-lite: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/parser@5.37.0(eslint@8.7.0)(typescript@5.3.3): - resolution: {integrity: sha512-01VzI/ipYKuaG5PkE5+qyJ6m02fVALmMPY3Qq5BHflDx3y4VobbLdHQkSMg9VPRS4KdNt4oYTMaomFoHonBGAw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/parser@6.19.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.37.0 - '@typescript-eslint/types': 5.37.0 - '@typescript-eslint/typescript-estree': 5.37.0(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.19.0 + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/typescript-estree': 6.19.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.19.0 debug: 4.3.4(supports-color@8.1.1) - eslint: 8.7.0 + eslint: 8.56.0 typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/scope-manager@5.37.0: - resolution: {integrity: sha512-F67MqrmSXGd/eZnujjtkPgBQzgespu/iCZ+54Ok9X5tALb9L2v3G+QBSoWkXG0p3lcTJsL+iXz5eLUEdSiJU9Q==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/scope-manager@6.1.0: + resolution: {integrity: sha512-AxjgxDn27hgPpe2rQe19k0tXw84YCOsjDJ2r61cIebq1t+AIxbgiXKvD4999Wk49GVaAcdJ/d49FYel+Pp3jjw==} + engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 5.37.0 - '@typescript-eslint/visitor-keys': 5.37.0 + '@typescript-eslint/types': 6.1.0 + '@typescript-eslint/visitor-keys': 6.1.0 dev: false - /@typescript-eslint/type-utils@5.37.0(eslint@8.7.0)(typescript@5.3.3): - resolution: {integrity: sha512-BSx/O0Z0SXOF5tY0bNTBcDEKz2Ec20GVYvq/H/XNKiUorUFilH7NPbFUuiiyzWaSdN3PA8JV0OvYx0gH/5aFAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/scope-manager@6.19.0: + resolution: {integrity: sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/visitor-keys': 6.19.0 + dev: false + + /@typescript-eslint/type-utils@6.1.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-kFXBx6QWS1ZZ5Ni89TyT1X9Ag6RXVIVhqDs0vZE/jUeWlBv/ixq2diua6G7ece6+fXw3TvNRxP77/5mOMusx2w==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: '*' + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.37.0(typescript@5.3.3) - '@typescript-eslint/utils': 5.37.0(eslint@8.7.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.1.0(typescript@5.3.3) + '@typescript-eslint/utils': 6.1.0(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4(supports-color@8.1.1) - eslint: 8.7.0 - tsutils: 3.21.0(typescript@5.3.3) + eslint: 8.56.0 + ts-api-utils: 1.0.3(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/types@5.37.0: - resolution: {integrity: sha512-3frIJiTa5+tCb2iqR/bf7XwU20lnU05r/sgPJnRpwvfZaqCJBrl8Q/mw9vr3NrNdB/XtVyMA0eppRMMBqdJ1bA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/types@6.1.0: + resolution: {integrity: sha512-+Gfd5NHCpDoHDOaU/yIF3WWRI2PcBRKKpP91ZcVbL0t5tQpqYWBs3z/GGhvU+EV1D0262g9XCnyqQh19prU0JQ==} + engines: {node: ^16.0.0 || >=18.0.0} dev: false - /@typescript-eslint/typescript-estree@5.37.0(typescript@5.3.3): - resolution: {integrity: sha512-JkFoFIt/cx59iqEDSgIGnQpCTRv96MQnXCYvJi7QhBC24uyuzbD8wVbajMB1b9x4I0octYFJ3OwjAwNqk1AjDA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/types@6.19.0: + resolution: {integrity: sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: false + + /@typescript-eslint/typescript-estree@6.1.0(typescript@5.3.3): + resolution: {integrity: sha512-nUKAPWOaP/tQjU1IQw9sOPCDavs/iU5iYLiY/6u7gxS7oKQoi4aUxXS1nrrVGTyBBaGesjkcwwHkbkiD5eBvcg==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.37.0 - '@typescript-eslint/visitor-keys': 5.37.0 + '@typescript-eslint/types': 6.1.0 + '@typescript-eslint/visitor-keys': 6.1.0 debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 - semver: 7.3.8 - tsutils: 3.21.0(typescript@5.3.3) + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/utils@5.37.0(eslint@8.7.0)(typescript@5.3.3): - resolution: {integrity: sha512-jUEJoQrWbZhmikbcWSMDuUSxEE7ID2W/QCV/uz10WtQqfOuKZUqFGjqLJ+qhDd17rjgp+QJPqTdPIBWwoob2NQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/typescript-estree@6.19.0(typescript@5.3.3): + resolution: {integrity: sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true dependencies: - '@types/json-schema': 7.0.9 - '@typescript-eslint/scope-manager': 5.37.0 - '@typescript-eslint/types': 5.37.0 - '@typescript-eslint/typescript-estree': 5.37.0(typescript@5.3.3) - eslint: 8.7.0 - eslint-scope: 5.1.1 - eslint-utils: 3.0.0(eslint@8.7.0) + '@typescript-eslint/types': 6.19.0 + '@typescript-eslint/visitor-keys': 6.19.0 + debug: 4.3.4(supports-color@8.1.1) + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.3.3) + typescript: 5.3.3 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/utils@6.1.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-wp652EogZlKmQoMS5hAvWqRKplXvkuOnNzZSE0PVvsKjpexd/XznRVHAtrfHFYmqaJz0DFkjlDsGYC9OXw+OhQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) + '@types/json-schema': 7.0.15 + '@types/semver': 7.5.6 + '@typescript-eslint/scope-manager': 6.1.0 + '@typescript-eslint/types': 6.1.0 + '@typescript-eslint/typescript-estree': 6.1.0(typescript@5.3.3) + eslint: 8.56.0 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript dev: false - /@typescript-eslint/visitor-keys@5.37.0: - resolution: {integrity: sha512-Hp7rT4cENBPIzMwrlehLW/28EVCOcE9U1Z1BQTc8EA8v5qpr7GRGuG+U58V5tTY48zvUOA3KHvw3rA8tY9fbdA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/visitor-keys@6.1.0: + resolution: {integrity: sha512-yQeh+EXhquh119Eis4k0kYhj9vmFzNpbhM3LftWQVwqVjipCkwHBQOZutcYW+JVkjtTG9k8nrZU1UoNedPDd1A==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.1.0 + eslint-visitor-keys: 3.4.3 + dev: false + + /@typescript-eslint/visitor-keys@6.19.0: + resolution: {integrity: sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==} + engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 5.37.0 - eslint-visitor-keys: 3.3.0 + '@typescript-eslint/types': 6.19.0 + eslint-visitor-keys: 3.4.3 dev: false /@ungap/promise-all-settled@1.1.2: resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} dev: false + /@ungap/structured-clone@1.2.0: + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + dev: false + /@vitest/expect@0.34.6: resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} dependencies: @@ -1300,12 +1137,12 @@ packages: negotiator: 0.6.2 dev: false - /acorn-jsx@5.3.2(acorn@8.7.0): + /acorn-jsx@5.3.2(acorn@8.11.2): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.7.0 + acorn: 8.11.2 dev: false /acorn-walk@8.2.0: @@ -1322,7 +1159,6 @@ packages: resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} engines: {node: '>=0.4.0'} hasBin: true - dev: true /acorn@8.7.0: resolution: {integrity: sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==} @@ -1410,17 +1246,6 @@ packages: is-array-buffer: 3.0.2 dev: false - /array-includes@3.1.5: - resolution: {integrity: sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.1.4 - es-abstract: 1.21.1 - get-intrinsic: 1.2.0 - is-string: 1.0.7 - dev: false - /array-includes@3.1.6: resolution: {integrity: sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==} engines: {node: '>= 0.4'} @@ -1437,16 +1262,6 @@ packages: engines: {node: '>=8'} dev: false - /array.prototype.flat@1.3.0: - resolution: {integrity: sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.1.4 - es-abstract: 1.21.1 - es-shim-unscopables: 1.0.0 - dev: false - /array.prototype.flat@1.3.1: resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} engines: {node: '>= 0.4'} @@ -1567,16 +1382,6 @@ packages: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} dev: false - /browserslist@4.21.4: - resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - dependencies: - caniuse-lite: 1.0.30001402 - electron-to-chromium: 1.4.254 - node-releases: 2.0.6 - update-browserslist-db: 1.0.9(browserslist@4.21.4) - dev: false - /buffer-alloc-unsafe@1.1.0: resolution: {integrity: sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==} dev: false @@ -1705,10 +1510,6 @@ packages: engines: {node: '>=10'} dev: false - /caniuse-lite@1.0.30001402: - resolution: {integrity: sha512-Mx4MlhXO5NwuvXGgVb+hg65HZ+bhUYsz8QtDGDo2QmaJS2GBX47Xfi2koL86lc8K+l+htXeTEB/Aeqvezoo6Ew==} - dev: false - /capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} dependencies: @@ -1825,6 +1626,12 @@ packages: /ci-info@3.3.0: resolution: {integrity: sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==} + dev: true + + /ci-info@3.9.0: + resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} + engines: {node: '>=8'} + dev: false /clean-regexp@1.0.0: resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==} @@ -1934,8 +1741,8 @@ packages: typedarray: 0.0.6 dev: false - /confusing-browser-globals@1.0.10: - resolution: {integrity: sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==} + /confusing-browser-globals@1.0.11: + resolution: {integrity: sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==} dev: false /constant-case@3.0.4: @@ -2043,18 +1850,6 @@ packages: ms: 2.1.3 dev: false - /debug@4.3.3: - resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: false - /debug@4.3.4(supports-color@8.1.1): resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -2280,10 +2075,6 @@ packages: resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} dev: false - /electron-to-chromium@1.4.254: - resolution: {integrity: sha512-Sh/7YsHqQYkA6ZHuHMy24e6TE4eX6KZVsZb9E/DvU1nQRIrH4BflO/4k+83tfdYvDl+MObvlqHPRICzEdC9c6Q==} - dev: false - /emmet@2.3.6: resolution: {integrity: sha512-pLS4PBPDdxuUAmw7Me7+TcHbykTsBKN/S9XJbUOMFQrNv9MoshzyMFK/R57JBm94/6HSL4vHnDeEmxlC82NQ4A==} dependencies: @@ -2672,103 +2463,100 @@ packages: source-map: 0.6.1 dev: false - /eslint-config-prettier@8.5.0(eslint@8.7.0): - resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} + /eslint-config-prettier@8.10.0(eslint@8.56.0): + resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.7.0 + eslint: 8.56.0 dev: false - /eslint-config-xo-react@0.25.0(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.7.0): - resolution: {integrity: sha512-YpABFxnoATAYtxsZQChZEbOkWqzCtcQDRdiUqHhLgG7hzbAEzPDmsRUWnTP8oTVLVFWrbgdf913b8kQJaR1cBA==} - engines: {node: '>=10'} + /eslint-config-xo-react@0.27.0(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.56.0): + resolution: {integrity: sha512-wiV215xQIn71XZyyVfaOXHaFpR1B14IJttwOjMi/eqUK1s+ojJdHr7eHqTLaGUfh6FKgWha1QNwePlIXx7mBUg==} + engines: {node: '>=12'} peerDependencies: - eslint: '>=7' - eslint-plugin-react: '>=7.22.0' - eslint-plugin-react-hooks: '>=4.2.0' + eslint: '>=8.6.0' + eslint-plugin-react: '>=7.29.0' + eslint-plugin-react-hooks: '>=4.3.0' dependencies: - eslint: 8.7.0 - eslint-plugin-react: 7.32.2(eslint@8.7.0) - eslint-plugin-react-hooks: 4.6.0(eslint@8.7.0) + eslint: 8.56.0 + eslint-plugin-react: 7.32.2(eslint@8.56.0) + eslint-plugin-react-hooks: 4.6.0(eslint@8.56.0) dev: false - /eslint-config-xo-typescript@0.47.1(@typescript-eslint/eslint-plugin@5.37.0)(eslint@8.7.0)(typescript@5.3.3): - resolution: {integrity: sha512-BkbzIltZCWp8QLekKJKG8zJ/ZGezD8Z9FaJ+hJ5PrAVUGkIPmxXLLEHCKS3ax7oOqZLYQiG+jyKfQDIEdTQgbg==} - engines: {node: '>=12'} + /eslint-config-xo-typescript@1.0.1(@typescript-eslint/eslint-plugin@6.1.0)(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-vPQssnRSUgBFOEfB/KY12CXwltwFSn4RSCfa+w7gjBC2PFQ7Yfgmyei+1XUZ3K+8LRGef2NMJUcxts7PldhDjg==} + engines: {node: '>=16'} peerDependencies: - '@typescript-eslint/eslint-plugin': '>=5.0.0' + '@typescript-eslint/eslint-plugin': '>=6.0.0' + '@typescript-eslint/parser': '>=6.0.0' eslint: '>=8.0.0' - typescript: '>=4.4' + typescript: '>=4.7' dependencies: - '@typescript-eslint/eslint-plugin': 5.37.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0)(typescript@5.3.3) - eslint: 8.7.0 + '@typescript-eslint/eslint-plugin': 6.1.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 typescript: 5.3.3 dev: false - /eslint-config-xo@0.39.0(eslint@8.7.0): - resolution: {integrity: sha512-QX+ZnQgzy/UtgF8dksIiIBzpYoEKmiL0CmZ8O0Gnby7rGXg8Cny1CXirmHp1zKYIpO7BuTmtWj8eUYOsGr0IGQ==} - engines: {node: '>=10'} + /eslint-config-xo@0.43.1(eslint@8.56.0): + resolution: {integrity: sha512-azv1L2PysRA0NkZOgbndUpN+581L7wPqkgJOgxxw3hxwXAbJgD6Hqb/SjHRiACifXt/AvxCzE/jIKFAlI7XjvQ==} + engines: {node: '>=12'} peerDependencies: - eslint: '>=7.20.0' + eslint: '>=8.27.0' dependencies: - confusing-browser-globals: 1.0.10 - eslint: 8.7.0 + confusing-browser-globals: 1.0.11 + eslint: 8.56.0 dev: false - /eslint-config-zardoy@0.2.12(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.7.0)(typescript@5.3.3): - resolution: {integrity: sha512-zFgNruQu/0O83U8q5v8GRj1sTLWGEc2ITO4ATWOXo0zZXOY3YSsyxggUAxrYWTlWIHsKNyCFRtJ4TUaglXjnyw==} + /eslint-config-zardoy@0.2.17(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-d31WsjyVSQqHbzTpBSmH96+nw5gwY2yhDbZatU89gr+U8ou1FRUkJSApYJUgmcINt8AQocj1RDDAVYmVSILZgQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: eslint: ^8.5.0 - eslint-plugin-react: ^7.27.1 - eslint-plugin-react-hooks: ^4.3.0 eslint-plugin-vue: ^8.4.1 typescript: ^4.5.2 vue-eslint-parser: ^8.2.0 peerDependenciesMeta: - eslint-plugin-react: - optional: true - eslint-plugin-react-hooks: - optional: true eslint-plugin-vue: optional: true vue-eslint-parser: optional: true dependencies: - '@rushstack/eslint-patch': 1.2.0 - '@typescript-eslint/eslint-plugin': 5.37.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0)(typescript@5.3.3) - '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.3.3) - eslint: 8.7.0 - eslint-config-prettier: 8.5.0(eslint@8.7.0) - eslint-config-xo: 0.39.0(eslint@8.7.0) - eslint-config-xo-react: 0.25.0(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.7.0) - eslint-config-xo-typescript: 0.47.1(@typescript-eslint/eslint-plugin@5.37.0)(eslint@8.7.0)(typescript@5.3.3) - eslint-plugin-eslint-comments: 3.2.0(eslint@8.7.0) - eslint-plugin-import: 2.26.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0) - eslint-plugin-node: 11.1.0(eslint@8.7.0) - eslint-plugin-react: 7.32.2(eslint@8.7.0) - eslint-plugin-react-hooks: 4.6.0(eslint@8.7.0) - eslint-plugin-sonarjs: 0.11.0(eslint@8.7.0) - eslint-plugin-unicorn: 39.0.0(eslint@8.7.0) + '@rushstack/eslint-patch': 1.6.1 + '@typescript-eslint/eslint-plugin': 6.1.0(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + eslint: 8.56.0 + eslint-config-prettier: 8.10.0(eslint@8.56.0) + eslint-config-xo: 0.43.1(eslint@8.56.0) + eslint-config-xo-react: 0.27.0(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.32.2)(eslint@8.56.0) + eslint-config-xo-typescript: 1.0.1(@typescript-eslint/eslint-plugin@6.1.0)(@typescript-eslint/parser@6.19.0)(eslint@8.56.0)(typescript@5.3.3) + eslint-plugin-eslint-comments: 3.2.0(eslint@8.56.0) + eslint-plugin-import: 2.27.5(@typescript-eslint/parser@6.19.0)(eslint@8.56.0) + eslint-plugin-node: 11.1.0(eslint@8.56.0) + eslint-plugin-sonarjs: 0.19.0(eslint@8.56.0) + eslint-plugin-unicorn: 48.0.0(eslint@8.56.0) typescript: 5.3.3 transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack + - eslint-plugin-react + - eslint-plugin-react-hooks - supports-color dev: false - /eslint-import-resolver-node@0.3.6: - resolution: {integrity: sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==} + /eslint-import-resolver-node@0.3.9: + resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} dependencies: debug: 3.2.7 - resolve: 1.22.1 + is-core-module: 2.13.1 + resolve: 1.22.8 transitivePeerDependencies: - supports-color dev: false - /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.37.0)(eslint-import-resolver-node@0.3.6)(eslint@8.7.0): + /eslint-module-utils@2.7.4(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0): resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} engines: {node: '>=4'} peerDependencies: @@ -2789,38 +2577,38 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) debug: 3.2.7 - eslint: 8.7.0 - eslint-import-resolver-node: 0.3.6 + eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color dev: false - /eslint-plugin-es@3.0.1(eslint@8.7.0): + /eslint-plugin-es@3.0.1(eslint@8.56.0): resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '>=4.19.1' dependencies: - eslint: 8.7.0 + eslint: 8.56.0 eslint-utils: 2.1.0 regexpp: 3.2.0 dev: false - /eslint-plugin-eslint-comments@3.2.0(eslint@8.7.0): + /eslint-plugin-eslint-comments@3.2.0(eslint@8.56.0): resolution: {integrity: sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==} engines: {node: '>=6.5.0'} peerDependencies: eslint: '>=4.19.1' dependencies: escape-string-regexp: 1.0.5 - eslint: 8.7.0 + eslint: 8.56.0 ignore: 5.2.0 dev: false - /eslint-plugin-import@2.26.0(@typescript-eslint/parser@5.37.0)(eslint@8.7.0): - resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} + /eslint-plugin-import@2.27.5(@typescript-eslint/parser@6.19.0)(eslint@8.56.0): + resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -2829,20 +2617,22 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.37.0(eslint@8.7.0)(typescript@5.3.3) - array-includes: 3.1.5 - array.prototype.flat: 1.3.0 - debug: 2.6.9 + '@typescript-eslint/parser': 6.19.0(eslint@8.56.0)(typescript@5.3.3) + array-includes: 3.1.6 + array.prototype.flat: 1.3.1 + array.prototype.flatmap: 1.3.1 + debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.7.0 - eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.37.0)(eslint-import-resolver-node@0.3.6)(eslint@8.7.0) + eslint: 8.56.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.7.4(@typescript-eslint/parser@6.19.0)(eslint-import-resolver-node@0.3.9)(eslint@8.56.0) has: 1.0.3 - is-core-module: 2.9.0 + is-core-module: 2.12.1 is-glob: 4.0.3 minimatch: 3.1.2 - object.values: 1.1.5 + object.values: 1.1.6 resolve: 1.22.1 + semver: 6.3.0 tsconfig-paths: 3.14.1 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -2850,14 +2640,14 @@ packages: - supports-color dev: false - /eslint-plugin-node@11.1.0(eslint@8.7.0): + /eslint-plugin-node@11.1.0(eslint@8.56.0): resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} engines: {node: '>=8.10.0'} peerDependencies: eslint: '>=5.16.0' dependencies: - eslint: 8.7.0 - eslint-plugin-es: 3.0.1(eslint@8.7.0) + eslint: 8.56.0 + eslint-plugin-es: 3.0.1(eslint@8.56.0) eslint-utils: 2.1.0 ignore: 5.2.0 minimatch: 3.1.2 @@ -2865,16 +2655,16 @@ packages: semver: 6.3.0 dev: false - /eslint-plugin-react-hooks@4.6.0(eslint@8.7.0): + /eslint-plugin-react-hooks@4.6.0(eslint@8.56.0): resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} engines: {node: '>=10'} peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 dependencies: - eslint: 8.7.0 + eslint: 8.56.0 dev: false - /eslint-plugin-react@7.32.2(eslint@8.7.0): + /eslint-plugin-react@7.32.2(eslint@8.56.0): resolution: {integrity: sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==} engines: {node: '>=4'} peerDependencies: @@ -2884,7 +2674,7 @@ packages: array.prototype.flatmap: 1.3.1 array.prototype.tosorted: 1.1.1 doctrine: 2.1.0 - eslint: 8.7.0 + eslint: 8.56.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.4 minimatch: 3.1.2 @@ -2898,72 +2688,47 @@ packages: string.prototype.matchall: 4.0.8 dev: false - /eslint-plugin-sonarjs@0.11.0(eslint@8.7.0): - resolution: {integrity: sha512-ei/WuZiL0wP+qx2KrxKyZs3+eDbxiGAhFSm3GKCOOAUkg+G2ny6TSXDB2j67tvyqHefi+eoQsAgGQvz+nEtIBw==} - engines: {node: '>=12'} + /eslint-plugin-sonarjs@0.19.0(eslint@8.56.0): + resolution: {integrity: sha512-6+s5oNk5TFtVlbRxqZN7FIGmjdPCYQKaTzFPmqieCmsU1kBYDzndTeQav0xtQNwZJWu5awWfTGe8Srq9xFOGnw==} + engines: {node: '>=14'} peerDependencies: - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0|| ^8.0.0 + eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.7.0 + eslint: 8.56.0 dev: false - /eslint-plugin-unicorn@39.0.0(eslint@8.7.0): - resolution: {integrity: sha512-fd5RK2FtYjGcIx3wra7csIE/wkkmBo22T1gZtRTsLr1Mb+KsFKJ+JOdSqhHXQUrI/JTs/Mon64cEYzTgSCbltw==} - engines: {node: '>=12'} + /eslint-plugin-unicorn@48.0.0(eslint@8.56.0): + resolution: {integrity: sha512-8fk/v3p1ro34JSVDBEmtOq6EEQRpMR0iTir79q69KnXFZ6DJyPkT3RAi+ZoTqhQMdDSpGh8BGR68ne1sP5cnAA==} + engines: {node: '>=16'} peerDependencies: - eslint: '>=7.32.0' + eslint: '>=8.44.0' dependencies: - '@babel/helper-validator-identifier': 7.19.1 - ci-info: 3.3.0 + '@babel/helper-validator-identifier': 7.22.5 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) + ci-info: 3.9.0 clean-regexp: 1.0.0 - eslint: 8.7.0 - eslint-template-visitor: 2.3.2(eslint@8.7.0) - eslint-utils: 3.0.0(eslint@8.7.0) - esquery: 1.4.0 + eslint: 8.56.0 + esquery: 1.5.0 indent-string: 4.0.0 - is-builtin-module: 3.2.0 + is-builtin-module: 3.2.1 + jsesc: 3.0.2 lodash: 4.17.21 pluralize: 8.0.0 read-pkg-up: 7.0.1 - regexp-tree: 0.1.24 - safe-regex: 2.1.1 - semver: 7.3.8 + regexp-tree: 0.1.27 + regjsparser: 0.10.0 + semver: 7.5.4 strip-indent: 3.0.0 - transitivePeerDependencies: - - supports-color - dev: false - - /eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 dev: false - /eslint-scope@7.1.0: - resolution: {integrity: sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==} + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 dev: false - /eslint-template-visitor@2.3.2(eslint@8.7.0): - resolution: {integrity: sha512-3ydhqFpuV7x1M9EK52BPNj6V0Kwu0KKkcIAfpUhwHbR8ocRln/oUHgfxQupY8O1h4Qv/POHDumb/BwwNfxbtnA==} - peerDependencies: - eslint: '>=7.0.0' - dependencies: - '@babel/core': 7.19.1 - '@babel/eslint-parser': 7.19.1(@babel/core@7.19.1)(eslint@8.7.0) - eslint: 8.7.0 - eslint-visitor-keys: 2.1.0 - esquery: 1.4.0 - multimap: 1.1.0 - transitivePeerDependencies: - - supports-color - dev: false - /eslint-utils@2.1.0: resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} engines: {node: '>=6'} @@ -2971,86 +2736,70 @@ packages: eslint-visitor-keys: 1.3.0 dev: false - /eslint-utils@3.0.0(eslint@8.7.0): - resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} - engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} - peerDependencies: - eslint: '>=5' - dependencies: - eslint: 8.7.0 - eslint-visitor-keys: 2.1.0 - dev: false - /eslint-visitor-keys@1.3.0: resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} engines: {node: '>=4'} dev: false - /eslint-visitor-keys@2.1.0: - resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} - engines: {node: '>=10'} - dev: false - - /eslint-visitor-keys@3.2.0: - resolution: {integrity: sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==} + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: false - /eslint-visitor-keys@3.3.0: - resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: false - - /eslint@8.7.0: - resolution: {integrity: sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w==} + /eslint@8.56.0: + resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true dependencies: - '@eslint/eslintrc': 1.0.5 - '@humanwhocodes/config-array': 0.9.2 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) + '@eslint-community/regexpp': 4.10.0 + '@eslint/eslintrc': 2.1.4 + '@eslint/js': 8.56.0 + '@humanwhocodes/config-array': 0.11.14 + '@humanwhocodes/module-importer': 1.0.1 + '@nodelib/fs.walk': 1.2.8 + '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.3 + debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.1.0 - eslint-utils: 3.0.0(eslint@8.7.0) - eslint-visitor-keys: 3.2.0 - espree: 9.3.0 - esquery: 1.4.0 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 + esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 - functional-red-black-tree: 1.0.1 + find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.12.0 - ignore: 5.2.0 - import-fresh: 3.3.0 + globals: 13.24.0 + graphemer: 1.4.0 + ignore: 5.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 + 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.0.4 + minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.1 - regexpp: 3.2.0 + optionator: 0.9.3 strip-ansi: 6.0.1 - strip-json-comments: 3.1.1 text-table: 0.2.0 - v8-compile-cache: 2.3.0 transitivePeerDependencies: - supports-color dev: false - /espree@9.3.0: - resolution: {integrity: sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==} + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.7.0 - acorn-jsx: 5.3.2(acorn@8.7.0) - eslint-visitor-keys: 3.2.0 + acorn: 8.11.2 + acorn-jsx: 5.3.2(acorn@8.11.2) + eslint-visitor-keys: 3.4.3 dev: false /esprima@3.1.3: @@ -3063,8 +2812,8 @@ packages: engines: {node: '>=4'} dev: false - /esquery@1.4.0: - resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} + /esquery@1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} engines: {node: '>=0.10'} dependencies: estraverse: 5.3.0 @@ -3254,7 +3003,7 @@ packages: resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} engines: {node: ^10.12.0 || >=12.0.0} dependencies: - flatted: 3.2.4 + flatted: 3.2.9 rimraf: 3.0.2 dev: false @@ -3262,13 +3011,8 @@ packages: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} dev: false - /flatted@3.2.4: - resolution: {integrity: sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==} - dev: false - /flatted@3.2.9: resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} - dev: true /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -3325,6 +3069,10 @@ packages: /function-bind@1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: false + /function.prototype.name@1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} engines: {node: '>= 0.4'} @@ -3335,10 +3083,6 @@ packages: functions-have-names: 1.2.3 dev: false - /functional-red-black-tree@1.0.1: - resolution: {integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=} - dev: false - /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: false @@ -3358,11 +3102,6 @@ packages: typescript: 5.3.3 dev: false - /gensync@1.0.0-beta.2: - resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} - engines: {node: '>=6.9.0'} - dev: false - /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} @@ -3479,13 +3218,8 @@ packages: once: 1.4.0 dev: false - /globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - dev: false - - /globals@13.12.0: - resolution: {integrity: sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==} + /globals@13.24.0: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -3560,6 +3294,10 @@ packages: /graceful-fs@4.2.9: resolution: {integrity: sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==} + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + dev: false + /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: false @@ -3601,6 +3339,13 @@ packages: dependencies: function-bind: 1.1.1 + /hasown@2.0.0: + resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: false + /he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} dev: false @@ -3706,13 +3451,13 @@ packages: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: false - /ignore@4.0.6: - resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} + /ignore@5.2.0: + resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} engines: {node: '>= 4'} dev: false - /ignore@5.2.0: - resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} + /ignore@5.3.0: + resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} engines: {node: '>= 4'} dev: false @@ -3725,7 +3470,7 @@ packages: dev: false /imurmurhash@0.1.4: - resolution: {integrity: sha1-khi5srkoojixPcT7a21XbyMUU+o=} + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} dev: false @@ -3801,8 +3546,8 @@ packages: has-tostringtag: 1.0.0 dev: false - /is-builtin-module@3.2.0: - resolution: {integrity: sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==} + /is-builtin-module@3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} engines: {node: '>=6'} dependencies: builtin-modules: 3.3.0 @@ -3825,6 +3570,12 @@ packages: has: 1.0.3 dev: false + /is-core-module@2.13.1: + resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + dependencies: + hasown: 2.0.0 + dev: false + /is-core-module@2.9.0: resolution: {integrity: sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==} dependencies: @@ -4018,9 +3769,15 @@ packages: argparse: 2.0.1 dev: false - /jsesc@2.5.2: - resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} - engines: {node: '>=4'} + /jsesc@0.5.0: + resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} + hasBin: true + dev: false + + /jsesc@3.0.2: + resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + engines: {node: '>=6'} + hasBin: true dev: false /json-buffer@3.0.1: @@ -4044,7 +3801,7 @@ packages: dev: false /json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=} + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} dev: false /json-stable-stringify@1.0.1: @@ -4055,15 +3812,11 @@ packages: /json5@1.0.1: resolution: {integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==} + hasBin: true dependencies: minimist: 1.2.6 dev: false - /json5@2.2.1: - resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==} - engines: {node: '>=6'} - dev: false - /jsonc-parser@2.3.1: resolution: {integrity: sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg==} dev: false @@ -4202,7 +3955,7 @@ packages: dev: false /levn@0.3.0: - resolution: {integrity: sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=} + resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==} engines: {node: '>= 0.8.0'} dependencies: prelude-ls: 1.1.2 @@ -4436,12 +4189,6 @@ packages: engines: {node: '>=4'} dev: false - /minimatch@3.0.4: - resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} - dependencies: - brace-expansion: 1.1.11 - dev: false - /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -4570,10 +4317,6 @@ packages: resolution: {integrity: sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==} dev: false - /multimap@1.1.0: - resolution: {integrity: sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw==} - dev: false - /nanoid@3.2.0: resolution: {integrity: sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -4589,6 +4332,10 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} dev: true + /natural-compare-lite@1.4.0: + resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} + dev: false + /natural-compare@1.4.0: resolution: {integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=} dev: false @@ -4616,10 +4363,6 @@ packages: is-stream: 1.1.0 dev: false - /node-releases@2.0.6: - resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} - dev: false - /normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: @@ -4723,15 +4466,6 @@ packages: es-abstract: 1.21.3 dev: false - /object.values@1.1.5: - resolution: {integrity: sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.1.4 - es-abstract: 1.21.1 - dev: false - /object.values@1.1.6: resolution: {integrity: sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==} engines: {node: '>= 0.4'} @@ -4790,16 +4524,16 @@ packages: word-wrap: 1.2.3 dev: false - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - word-wrap: 1.2.3 dev: false /p-cancelable@2.1.1: @@ -4984,6 +4718,7 @@ packages: /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -5299,8 +5034,9 @@ packages: picomatch: 2.3.1 dev: false - /regexp-tree@0.1.24: - resolution: {integrity: sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw==} + /regexp-tree@0.1.27: + resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} + hasBin: true dev: false /regexp.prototype.flags@1.4.3: @@ -5326,6 +5062,13 @@ packages: engines: {node: '>=8'} dev: false + /regjsparser@0.10.0: + resolution: {integrity: sha512-qx+xQGZVsy55CH0a1hiVwHmqjLryfh7wQyF5HO07XJ9f7dQMY/gPQHhlyDkIzJKC+x2fUCpCcUODUUUFrm7SHA==} + hasBin: true + dependencies: + jsesc: 0.5.0 + dev: false + /request-light@0.7.0: resolution: {integrity: sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==} dev: false @@ -5368,11 +5111,20 @@ packages: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + /resolve@1.22.8: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + dependencies: + is-core-module: 2.13.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: false + /resolve@2.0.0-next.4: resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} hasBin: true dependencies: - is-core-module: 2.12.1 + is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 dev: false @@ -5438,12 +5190,6 @@ packages: is-regex: 1.1.4 dev: false - /safe-regex@2.1.1: - resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} - dependencies: - regexp-tree: 0.1.24 - dev: false - /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: false @@ -5844,7 +5590,7 @@ packages: dev: false /text-table@0.2.0: - resolution: {integrity: sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=} + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: false /through2@2.0.5: @@ -5916,6 +5662,15 @@ packages: resolution: {integrity: sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==} dev: false + /ts-api-utils@1.0.3(typescript@5.3.3): + resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} + engines: {node: '>=16.13.0'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.3.3 + dev: false + /ts-expose-internals@5.3.3: resolution: {integrity: sha512-0lW96u0pa08dq9QLYUBRbgGkvsD+LvPAVGe94kr2tHaRZAxgckwJ+qqc1BSRoR1rpkTZf7AWAa6DKrLGFmctwg==} dev: false @@ -5970,10 +5725,6 @@ packages: strip-bom: 3.0.0 dev: false - /tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - dev: false - /tslib@2.3.1: resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} dev: false @@ -5990,16 +5741,6 @@ packages: engines: {node: '>=0.6.x'} dev: false - /tsutils@3.21.0(typescript@5.3.3): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - 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' - dependencies: - tslib: 1.14.1 - typescript: 5.3.3 - dev: false - /type-check@0.3.2: resolution: {integrity: sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=} engines: {node: '>= 0.8.0'} @@ -6206,17 +5947,6 @@ packages: setimmediate: 1.0.5 dev: false - /update-browserslist-db@1.0.9(browserslist@4.21.4): - resolution: {integrity: sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - dependencies: - browserslist: 4.21.4 - escalade: 3.1.1 - picocolors: 1.0.0 - dev: false - /upper-case-first@2.0.2: resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} dependencies: @@ -6243,10 +5973,6 @@ packages: resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=} dev: false - /v8-compile-cache@2.3.0: - resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} - dev: false - /validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: diff --git a/src/apiCommands.ts b/src/apiCommands.ts index a652385..1e16f77 100644 --- a/src/apiCommands.ts +++ b/src/apiCommands.ts @@ -15,7 +15,7 @@ type RequestOptions = Partial<{ }> /** @unique */ -const cacheableCommands: Set<(typeof passthroughExposedApiCommands)[number]> = new Set(['getNodePath', 'getSpanOfEnclosingComment', 'getNodeAtPosition']) +const cacheableCommands = new Set<(typeof passthroughExposedApiCommands)[number]>(['getNodePath', 'getSpanOfEnclosingComment', 'getNodeAtPosition']) const operationsCache = new Map() export const sharedApiRequest = async (type: TriggerCharacterCommand, { offset, relativeOffset = 0, document, position }: RequestOptions) => { if (position && offset) throw new Error('Only position or offset parameter can be provided') diff --git a/src/extension.ts b/src/extension.ts index 51d6d76..a60488d 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -111,7 +111,7 @@ export const activate = async () => { if (tsExtension) { await tsExtension.activate() - if (!tsExtension.exports || !tsExtension.exports.getAPI) { + if (!tsExtension.exports?.getAPI) { throw new Error("TS extension doesn't export API") } diff --git a/src/sendCommand.ts b/src/sendCommand.ts index 4c17a49..fa76024 100644 --- a/src/sendCommand.ts +++ b/src/sendCommand.ts @@ -6,7 +6,6 @@ import { passthroughExposedApiCommands, TriggerCharacterCommand, RequestInputTyp type SendCommandData = { position?: vscode.Position document?: vscode.TextDocument - // eslint-disable-next-line @typescript-eslint/ban-types } & ([Input] extends [never] ? {} : { inputOptions: Input }) export const sendCommand = async < diff --git a/src/specialCommands.ts b/src/specialCommands.ts index 0d72413..9b4d9dd 100644 --- a/src/specialCommands.ts +++ b/src/specialCommands.ts @@ -205,7 +205,7 @@ export default () => { label: document .getText(tsRangeToVscode(document, node.range)) .trim() - .replace(/\r?\n\s+/g, ' '), + .replaceAll(/\r?\n\s+/g, ' '), nodeRange: node.range, value: node, })) diff --git a/src/vueVolarSupport.ts b/src/vueVolarSupport.ts index 9381dba..49752be 100644 --- a/src/vueVolarSupport.ts +++ b/src/vueVolarSupport.ts @@ -83,13 +83,12 @@ const isConfigValueChanged = (settingId: string) => { path = path[0]!.toUpperCase() + path.slice(1) } - return path.replace(/\\/g, '/') + return path.replaceAll('\\', '/') } userValue = normalizePathWin(userValue) extensionsBasePath = normalizePathWin(extensionsBasePath) - if (userValue.startsWith(extensionsBasePath)) return false - return true + return !userValue.startsWith(extensionsBasePath) } return undefined diff --git a/typescript/src/adjustAutoImports.ts b/typescript/src/adjustAutoImports.ts index 91b5b18..9802682 100644 --- a/typescript/src/adjustAutoImports.ts +++ b/typescript/src/adjustAutoImports.ts @@ -3,7 +3,7 @@ import { addObjectMethodResultInterceptors, findChildContainingExactPosition } f let currentSymbolName: string | undefined -interface ParsedIgnoreSetting { +type ParsedIgnoreSetting = { module: string symbols: string[] isAnySymbol: boolean diff --git a/typescript/src/codeActions/custom/renameParameterToNameFromType.ts b/typescript/src/codeActions/custom/renameParameterToNameFromType.ts index f40e2e9..c3b1ceb 100644 --- a/typescript/src/codeActions/custom/renameParameterToNameFromType.ts +++ b/typescript/src/codeActions/custom/renameParameterToNameFromType.ts @@ -89,7 +89,6 @@ export const renameAllParametersToNameFromType = { if (paramsToRename.length < 2) return - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions this.name = `Rename All Parameters to Name from Type '${functionDecl.type?.getText()}'` if (!formatOptions) return true diff --git a/typescript/src/codeFixes.ts b/typescript/src/codeFixes.ts index fc6ab57..eff070c 100644 --- a/typescript/src/codeFixes.ts +++ b/typescript/src/codeFixes.ts @@ -36,7 +36,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, let sorting = '-1' if (placeholderIndexesInfo) { const targetModule = description[placeholderIndexesInfo[1] + 1] - const symbolName = placeholderIndexesInfo[2] !== undefined ? description[placeholderIndexesInfo[2] + 1] : (node as ts.Identifier).text + const symbolName = placeholderIndexesInfo[2] === undefined ? (node as ts.Identifier).text : description[placeholderIndexesInfo[2] + 1] const toIgnore = isAutoImportEntryShouldBeIgnored(ignoreAutoImportsSetting, targetModule, symbolName) @@ -201,7 +201,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, const sortFn = changeSortingOfAutoImport(c, fixes[0]!.symbolName) fixes = _.sortBy( fixes.filter(({ fix, symbolName }) => { - if (fix.kind === (ImportFixKind.PromoteTypeOnly as number)) return false + if ((fix.kind as number) === (ImportFixKind.PromoteTypeOnly as number)) return false const shouldBeIgnored = c('autoImport.alwaysIgnoreInImportAll').includes(fix.moduleSpecifier) || isAutoImportEntryShouldBeIgnored(ignoreAutoImportsSetting, fix.moduleSpecifier, symbolName) @@ -225,9 +225,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, ) if (namespaceImportAction) { fixes = [] - if (!namespaceImportAction.namespace) { - additionalTextChanges.push(...namespaceImportAction.textChanges) - } else { + if (namespaceImportAction.namespace) { const { namespace, useDefaultImport, textChanges } = namespaceImportAction additionalTextChanges.push(textChanges[1]!) fixes.unshift({ @@ -241,6 +239,8 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, }, symbolName: namespace, } as FixInfo) + } else { + additionalTextChanges.push(...namespaceImportAction.textChanges) } } if (!fixes[0]) throw new Error('No fixes') @@ -260,7 +260,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, importAdder.addImportFromDiagnostic({ ...diagnostic, file: sourceFile as unknown as FullSourceFile } as any, context) } catch (err) { if (err.message === 'No fixes') continue - throw err + throw err as Error } } finally { for (const unpatch of toUnpatch) { @@ -293,7 +293,7 @@ const getFixAllErrorCodes = () => { return errorCodes } -interface FixInfo { +type FixInfo = { readonly fix: ImportFix readonly symbolName: string readonly errorIdentifierText: string | undefined @@ -313,31 +313,31 @@ const enum ImportFixKind { type SymbolExportInfo = import('typescript-full').SymbolExportInfo // Properties are be undefined if fix is derived from an existing import -interface ImportFixBase { +type ImportFixBase = { readonly isReExport?: boolean readonly exportInfo?: SymbolExportInfo readonly moduleSpecifier: string } -interface FixUseNamespaceImport extends ImportFixBase { +type FixUseNamespaceImport = { readonly kind: ImportFixKind.UseNamespace readonly namespacePrefix: string readonly position: number -} -interface FixAddJsdocTypeImport extends ImportFixBase { +} & ImportFixBase +type FixAddJsdocTypeImport = { readonly kind: ImportFixKind.JsdocTypeImport readonly position: number readonly isReExport: boolean readonly exportInfo: SymbolExportInfo -} -interface FixAddToExistingImport extends ImportFixBase { +} & ImportFixBase +type FixAddToExistingImport = { readonly kind: ImportFixKind.AddToExisting // readonly importClauseOrBindingPattern: ImportClause | ObjectBindingPattern // readonly importKind: ImportKind.Default | ImportKind.Named // readonly addAsTypeOnly: AddAsTypeOnly -} -interface FixAddNewImport extends ImportFixBase { +} & ImportFixBase +type FixAddNewImport = { readonly kind: ImportFixKind.AddNew // readonly importKind: ImportKind // readonly addAsTypeOnly: AddAsTypeOnly readonly useRequire: boolean -} +} & ImportFixBase diff --git a/typescript/src/codeFixes/codeFixInterface.ts b/typescript/src/codeFixes/codeFixInterface.ts index b96cfda..52e0c4c 100644 --- a/typescript/src/codeFixes/codeFixInterface.ts +++ b/typescript/src/codeFixes/codeFixInterface.ts @@ -1,4 +1,4 @@ -export interface CodeFixInterface { +export type CodeFixInterface = { codes: number[] description?: string provideFix(diagnostic: ts.Diagnostic, startNode: ts.Node, sourceFile: ts.SourceFile, languageService: ts.LanguageService): ts.CodeFixAction | undefined diff --git a/typescript/src/completions/arrayMethods.ts b/typescript/src/completions/arrayMethods.ts index 73c4d9f..2f9c410 100644 --- a/typescript/src/completions/arrayMethods.ts +++ b/typescript/src/completions/arrayMethods.ts @@ -67,7 +67,6 @@ export default (entries: ts.CompletionEntry[], position: number, sourceFile: ts. return entries.map(entry => { if (!arrayMethodsToPatch.includes(entry.name.replace(/^★ /, ''))) { - // eslint-disable-next-line @typescript-eslint/prefer-optional-chain if (resetRangeKinds && resetRangeKinds.includes(entry.kind) && !entry.replacementSpan) { return { ...entry, diff --git a/typescript/src/completions/filterJsxComponents.ts b/typescript/src/completions/filterJsxComponents.ts index 149f6f6..435eb3e 100644 --- a/typescript/src/completions/filterJsxComponents.ts +++ b/typescript/src/completions/filterJsxComponents.ts @@ -39,7 +39,7 @@ export default (entries: ts.CompletionEntry[], node: ts.Node, position: number, ts.ScriptElementKind.memberVariableElement, ts.ScriptElementKind.memberFunctionElement, ] - const timings = {} + const timings = {} as Record const typeAtLocLog = {} const program = languageService.getProgram()! const typeChecker = program.getTypeChecker()! @@ -148,8 +148,7 @@ const isJsxOpeningElem = (position: number, node: ts.Node) => { const isJsxElement = (typeChecker: ts.TypeChecker, signatures: readonly ts.Signature[], type: ts.Type) => { if (signatures.length > 0 && signatures.every(signature => getIsJsxComponentSignature(typeChecker, signature))) return true // allow pattern: const Component = condition ? 'div' : 'a' - if (type.isUnion() && type.types.every(type => type.isStringLiteral())) return true - return false + return !!(type.isUnion() && type.types.every(type => type.isStringLiteral())) } const getIsJsxComponentSignature = (typeChecker: ts.TypeChecker, signature: ts.Signature) => { diff --git a/typescript/src/completions/jsxAttributes.ts b/typescript/src/completions/jsxAttributes.ts index 66bb306..727366b 100644 --- a/typescript/src/completions/jsxAttributes.ts +++ b/typescript/src/completions/jsxAttributes.ts @@ -84,11 +84,11 @@ export default ( const locals = collectLocalSymbols(node, sharedCompletionContext.typeChecker) entries = entries.flatMap(entry => { if (locals.includes(entry.name)) { - const insertText = entry.name + `={${entry.name}}` + const insertText = `${entry.name}={${entry.name}}` const additionalSuggestions = { ...entry, name: insertText, - insertText: insertText, + insertText, } return enableJsxAttributesShortcuts === 'after' ? [entry, additionalSuggestions] : [additionalSuggestions, entry] } diff --git a/typescript/src/completions/objectLiteralCompletions.ts b/typescript/src/completions/objectLiteralCompletions.ts index 9a39bf6..23e6dbb 100644 --- a/typescript/src/completions/objectLiteralCompletions.ts +++ b/typescript/src/completions/objectLiteralCompletions.ts @@ -164,7 +164,7 @@ const isObjectCompletion = (type: ts.Type, checker: ts.TypeChecker) => { if (type.flags & ts.TypeFlags.Object) { if ((type as ts.ObjectType).objectFlags & ts.ObjectFlags.Class) return false // complete with regexp? - if (type.symbol?.escapedName === 'RegExp') return false + if ((type.symbol?.escapedName as string) === 'RegExp') return false return true } if (type.isUnion()) return isEverySubtype(type, type => isObjectCompletion(type, checker)) diff --git a/typescript/src/completions/stringTemplateType.ts b/typescript/src/completions/stringTemplateType.ts index d5a966c..8e673e1 100644 --- a/typescript/src/completions/stringTemplateType.ts +++ b/typescript/src/completions/stringTemplateType.ts @@ -35,7 +35,7 @@ export default (): ts.CompletionEntry[] | void => { return buildStringCompletion(stringNode, { name: texts.map(text => (text === '' ? '|' : text)).join(''), sortText: '07', - insertText: texts.map(text => (text === '' ? `$${tabStop++}` : text.replace(/\$/g, '\\$'))).join(''), + insertText: texts.map(text => (text === '' ? `$${tabStop++}` : text.replaceAll('$', '\\$'))).join(''), isSnippet: true, }) }), diff --git a/typescript/src/completionsAtPosition.ts b/typescript/src/completionsAtPosition.ts index 746acbe..40b30cf 100644 --- a/typescript/src/completionsAtPosition.ts +++ b/typescript/src/completionsAtPosition.ts @@ -217,10 +217,7 @@ export const getCompletionsAtPosition = ( const fullText = sourceFile.getFullText() const currentWord = fullText.slice(0, position).match(/[\w\d]+$/) if (currentWord) { - prior.entries = prior.entries.filter(entry => { - if (entry.name.startsWith(currentWord[0])) return true - return false - }) + prior.entries = prior.entries.filter(entry => entry.name.startsWith(currentWord[0])) } } @@ -374,7 +371,7 @@ export const getCompletionsAtPosition = ( if (!goodPositionForMethodCompletions) { prior.entries = prior.entries.map(item => { if (item.isSnippet) return item - return { ...item, insertText: (item.insertText ?? item.name).replace(/\$/g, '\\$'), isSnippet: true } + return { ...item, insertText: (item.insertText ?? item.name).replaceAll('$', '\\$'), isSnippet: true } }) } diff --git a/typescript/src/decorateEditsForFileRename.ts b/typescript/src/decorateEditsForFileRename.ts index 3495784..14b56f1 100644 --- a/typescript/src/decorateEditsForFileRename.ts +++ b/typescript/src/decorateEditsForFileRename.ts @@ -10,7 +10,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, const predictedNameFromPath = (p: string) => { const input = p.split(/[/\\]/g).pop()!.replace(/\..+/, '') const transformed = camelCase(input) - // eslint-disable-next-line @typescript-eslint/prefer-optional-chain + const isFirstUppercase = input && input.startsWith(input[0]!.toUpperCase()) return isFirstUppercase ? transformed[0]!.toUpperCase() + transformed.slice(1) : transformed } diff --git a/typescript/src/decorateFormatFeatures.ts b/typescript/src/decorateFormatFeatures.ts index 3508c8e..7b5d1fd 100644 --- a/typescript/src/decorateFormatFeatures.ts +++ b/typescript/src/decorateFormatFeatures.ts @@ -15,7 +15,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, const isFormattingLineIgnored = (fullText: string, position: number) => { // check that lines before line are not ignored const linesBefore = fullText.slice(0, position).split('\n') - if (isExpectedDirective(linesBefore[linesBefore.length - 2], '@ts-format-ignore-line')) { + if (isExpectedDirective(linesBefore.at(-2), '@ts-format-ignore-line')) { return true } diff --git a/typescript/src/decorateProxy.ts b/typescript/src/decorateProxy.ts index 0232e82..bb0764d 100644 --- a/typescript/src/decorateProxy.ts +++ b/typescript/src/decorateProxy.ts @@ -93,7 +93,7 @@ export const decorateLanguageService = ( return result.completions } catch (err) { setTimeout(() => { - throw err + throw err as Error }) return { entries: [ diff --git a/typescript/src/definitions.ts b/typescript/src/definitions.ts index 77ee68d..77bd7a4 100644 --- a/typescript/src/definitions.ts +++ b/typescript/src/definitions.ts @@ -8,15 +8,12 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, if (c('removeModuleFileDefinitions') && prior) { prior.definitions = prior.definitions?.filter(def => { - if ( + return !( def.kind === ts.ScriptElementKind.moduleElement && def.name.slice(1, -1).startsWith('*.') && def.containerKind === undefined && (def as import('typescript-full').DefinitionInfo).isAmbient - ) { - return false - } - return true + ) }) } @@ -26,7 +23,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, return findChildContainingExactPosition(sourceFile, position) } - const noDefs = !prior || !prior.definitions || prior.definitions.length === 0 + const noDefs = !prior?.definitions || prior.definitions.length === 0 const tryFileResolve = noDefs || ['?', '#'].some(x => prior.definitions?.[0]?.fileName?.includes(x)) // Definition fallbacks @@ -153,6 +150,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, const isFcDef = filterOutReactFcDef && fileName.endsWith('node_modules/@types/react/index.d.ts') && containerName === 'FunctionComponent' if (isFcDef) return false // filter out css modules index definition + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison if (containerName === 'classes' && containerKind === undefined && rest['isAmbient'] && kind === 'index' && name === '__index') { // ensure we don't filter out something important? const nodeAtDefinition = findChildContainingExactPosition(languageService.getProgram()!.getSourceFile(fileName)!, textSpan.start) diff --git a/typescript/src/dummyLanguageService.ts b/typescript/src/dummyLanguageService.ts index 2611a5e..982753c 100644 --- a/typescript/src/dummyLanguageService.ts +++ b/typescript/src/dummyLanguageService.ts @@ -10,7 +10,7 @@ export const createLanguageService = (files: Record, { useLib = getScriptVersion: () => dummyVersion.toString(), getCompilationSettings: () => ({ allowJs: true, jsx: ts.JsxEmit.Preserve, target: ts.ScriptTarget.ESNext }), getScriptFileNames: () => Object.keys(files), - getScriptSnapshot: fileName => { + getScriptSnapshot(fileName) { let contents = files[fileName] if (useLib && path.dirname(fileName) === defaultLibDir) contents = ts.sys.readFile(fileName) if (contents === undefined) return @@ -20,7 +20,7 @@ export const createLanguageService = (files: Record, { useLib = return ts.ScriptKind.TSX }, getCurrentDirectory: () => '', - getDefaultLibFileName: options => { + getDefaultLibFileName(options) { const defaultLibPath = ts.getDefaultLibFilePath(options) defaultLibDir = path.dirname(defaultLibPath) return defaultLibPath diff --git a/typescript/src/getPatchedNavTree.ts b/typescript/src/getPatchedNavTree.ts index ebdf496..cf7a94a 100644 --- a/typescript/src/getPatchedNavTree.ts +++ b/typescript/src/getPatchedNavTree.ts @@ -10,7 +10,7 @@ type AdditionalFeatures = Record<'arraysTuplesNumberedItems', boolean> const getPatchedNavModule = (additionalFeatures: AdditionalFeatures): { getNavigationTree(...args) } => { // what is happening here: grabbing & patching NavigationBar module contents from actual running JS - const tsServerPath = typeof __TS_SEVER_PATH__ !== 'undefined' ? __TS_SEVER_PATH__ : require.main!.filename + const tsServerPath = __TS_SEVER_PATH__ === undefined ? require.main!.filename : __TS_SEVER_PATH__ // current lib/tsserver.js const mainScript = nodeModules!.fs.readFileSync(tsServerPath, 'utf8') type PatchData = { @@ -90,20 +90,20 @@ const getPatchedNavModule = (additionalFeatures: AdditionalFeatures): { getNavig patches, returnModuleCode, skipStartMarker = false, - }: PatchData = !isTs5() + }: PatchData = isTs5() ? { - markerModuleStart: 'var NavigationBar;', - markerModuleEnd: '(ts.NavigationBar = {}));', - patches: patchLocations, - returnModuleCode: 'NavigationBar', - } - : { markerModuleStart: '// src/services/navigationBar.ts', skipStartMarker: true, markerModuleEnd: '// src/', patches: patchLocations, returnModuleCode: '{ getNavigationTree }', } + : { + markerModuleStart: 'var NavigationBar;', + markerModuleEnd: '(ts.NavigationBar = {}));', + patches: patchLocations, + returnModuleCode: 'NavigationBar', + } const contentAfterModuleStart = mainScript.slice(mainScript.indexOf(markerModuleStart) + (skipStartMarker ? markerModuleStart.length : 0)) const lines = contentAfterModuleStart.slice(0, contentAfterModuleStart.indexOf(markerModuleEnd) + markerModuleEnd.length).split(/\r?\n/) @@ -114,10 +114,10 @@ const getPatchedNavModule = (additionalFeatures: AdditionalFeatures): { getNavig const newIndexStart = addTypeIndex + 1 addTypeIndex = newIndexStart + lines.slice(newIndexStart).findIndex(line => line.includes(search)) } - if (addTypeIndex !== -1) { - lines.splice(addTypeIndex + linesOffset, removeLines, ...(addString ? [addString] : [])) - } else { + if (addTypeIndex === -1) { console.error(`TS Essentials: Failed to patch NavBar module (outline): ${JSON.stringify(searchString)}`) + } else { + lines.splice(addTypeIndex + linesOffset, removeLines, ...(addString ? [addString] : [])) } } const getModuleString = () => `module.exports = (ts, getNameFromJsxTag) => {\n${lines.join('\n')}\nreturn ${returnModuleCode}}` diff --git a/typescript/src/references.ts b/typescript/src/references.ts index 62f7200..4021008 100644 --- a/typescript/src/references.ts +++ b/typescript/src/references.ts @@ -58,12 +58,14 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, let node = findChildContainingPositionMaxDepth(sourceFile, end, 6) if (!node) return true if (ts.isIdentifier(node)) node = node.parent - if ( - approveCast(node, ts.isNamedImports, ts.isImportSpecifier, ts.isImportClause, ts.isImportEqualsDeclaration, ts.isImportDeclaration) - ) { - return false - } - return true + return !approveCast( + node, + ts.isNamedImports, + ts.isImportSpecifier, + ts.isImportClause, + ts.isImportEqualsDeclaration, + ts.isImportDeclaration, + ) }), } }) diff --git a/typescript/src/specialCommands/handle.ts b/typescript/src/specialCommands/handle.ts index cf8a62c..7c47799 100644 --- a/typescript/src/specialCommands/handle.ts +++ b/typescript/src/specialCommands/handle.ts @@ -76,7 +76,7 @@ export default ( if (specialCommand === 'getNodeAtPosition') { // ensure return data is the same as for node in getNodePath const node = findChildContainingPosition(ts, sourceFile, position) - return !node ? undefined : nodeToApiResponse(node) + return node ? nodeToApiResponse(node) : undefined } if (specialCommand === 'getSpanOfEnclosingComment') { return languageService.getSpanOfEnclosingComment(fileName, position, false) diff --git a/typescript/src/utils.ts b/typescript/src/utils.ts index 11c5097..1aea5e6 100644 --- a/typescript/src/utils.ts +++ b/typescript/src/utils.ts @@ -234,7 +234,7 @@ export const getCancellationToken = (languageServiceHost: ts.LanguageServiceHost // } cancellationToken ??= { isCancellationRequested: () => false, - throwIfCancellationRequested: () => {}, + throwIfCancellationRequested() {}, } if (!cancellationToken.throwIfCancellationRequested) { cancellationToken.throwIfCancellationRequested = () => { @@ -297,7 +297,7 @@ export const patchMethod = (obj: T, method: K, overriden: } } -export const insertTextAfterEntry = (entryOrName: string, appendText: string) => entryOrName.replace(/\$/g, '\\$') + appendText +export const insertTextAfterEntry = (entryOrName: string, appendText: string) => entryOrName.replaceAll('$', '\\$') + appendText export const matchParents: MatchParentsType = (node, treeToCompare) => { let first = true diff --git a/typescript/src/volarConfig.ts b/typescript/src/volarConfig.ts index 7bc279a..df42b7c 100644 --- a/typescript/src/volarConfig.ts +++ b/typescript/src/volarConfig.ts @@ -119,7 +119,7 @@ const plugin: (...args: Parameters) => module.exports = { services: { - typescriptEssentialPlugins: (...args) => { + typescriptEssentialPlugins(...args) { ;(async () => { try { await plugin(...args) From 8bf14166c68fa855576dff135bc289de0053dd8a Mon Sep 17 00:00:00 2001 From: Vitaly Date: Wed, 17 Jan 2024 08:58:34 +0530 Subject: [PATCH 5/8] fix: custom declare missing propertly code fix was always displayed even when it couldn't be applied --- src/codeActionProvider.ts | 5 +++-- typescript/src/codeActions/getCodeActions.ts | 11 +++++++++-- typescript/src/ipcTypes.ts | 1 + typescript/src/specialCommands/handle.ts | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/codeActionProvider.ts b/src/codeActionProvider.ts index be25dc1..b867f49 100644 --- a/src/codeActionProvider.ts +++ b/src/codeActionProvider.ts @@ -42,7 +42,7 @@ export default () => { } if (context.triggerKind !== vscode.CodeActionTriggerKind.Invoke) return - const result = await getPossibleTwoStepRefactorings(range) + const result = await getPossibleTwoStepRefactorings(range, document, context.diagnostics) if (!result) return const { turnArrayIntoObject, extendedCodeActions } = result const codeActions: vscode.CodeAction[] = [] @@ -147,12 +147,13 @@ export default () => { await vscode.workspace.applyEdit(edit) }) - async function getPossibleTwoStepRefactorings(range: vscode.Range, document = vscode.window.activeTextEditor!.document) { + async function getPossibleTwoStepRefactorings(range: vscode.Range, document: vscode.TextDocument, diagnostics: Readonly) { return sendCommand('getTwoStepCodeActions', { document, position: range.start, inputOptions: { range: vscodeRangeToTs(document, range), + diagnostics: diagnostics.filter(({ source }) => source === 'ts').map(({ code }) => (typeof code === 'object' ? +code.value : +code!)), }, }) } diff --git a/typescript/src/codeActions/getCodeActions.ts b/typescript/src/codeActions/getCodeActions.ts index 525e5cc..8ce4fc2 100644 --- a/typescript/src/codeActions/getCodeActions.ts +++ b/typescript/src/codeActions/getCodeActions.ts @@ -80,6 +80,7 @@ export const getExtendedCodeActions = ( // languageServiceHost: ts.LanguageServiceHost, formatOptions: ts.FormatCodeSettings | undefined, applyCodeActionTitle: T, + filterErrorCodes?: number[], ): T extends undefined ? ExtendedCodeAction[] : ApplyExtendedCodeActionResult => { const range = typeof positionOrRange !== 'number' && positionOrRange.pos !== positionOrRange.end ? positionOrRange : undefined const position = typeof positionOrRange === 'number' ? positionOrRange : positionOrRange.pos @@ -99,8 +100,14 @@ export const getExtendedCodeActions = ( } return compact( extendedCodeActions.map(codeAction => { - if (!codeAction.codes && !codeAction.tryToApply(tryToApplyOptions)) return - return codeAction + if ( + !filterErrorCodes || + !codeAction.codes || + (codeAction.codes.some(c => filterErrorCodes.includes(c)) && codeAction.tryToApply(tryToApplyOptions)) + ) { + return codeAction + } + return }), ) as T extends undefined ? ExtendedCodeAction[] : never } diff --git a/typescript/src/ipcTypes.ts b/typescript/src/ipcTypes.ts index 91dcadc..2bd55d9 100644 --- a/typescript/src/ipcTypes.ts +++ b/typescript/src/ipcTypes.ts @@ -51,6 +51,7 @@ export type RequestInputTypes = { } getTwoStepCodeActions: { range: [number, number] + diagnostics: number[] } twoStepCodeActionSecondStep: { range: [number, number] diff --git a/typescript/src/specialCommands/handle.ts b/typescript/src/specialCommands/handle.ts index 7c47799..ac35702 100644 --- a/typescript/src/specialCommands/handle.ts +++ b/typescript/src/specialCommands/handle.ts @@ -40,7 +40,7 @@ export default ( const node = findChildContainingPosition(ts, sourceFile, position) const posEnd = { pos: specialCommandArg.range[0], end: specialCommandArg.range[1] } - const extendedCodeActions = getExtendedCodeActions(sourceFile, posEnd, languageService, undefined, undefined) + const extendedCodeActions = getExtendedCodeActions(sourceFile, posEnd, languageService, undefined, undefined, specialCommandArg.diagnostics) return { turnArrayIntoObject: objectIntoArrayConverters(posEnd, node, undefined), extendedCodeActions, From facbf3067f236d1e422168602a72ff4658726345 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Wed, 17 Jan 2024 09:02:54 +0530 Subject: [PATCH 6/8] ptx --- typescript/src/decorateEditsForFileRename.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/src/decorateEditsForFileRename.ts b/typescript/src/decorateEditsForFileRename.ts index 14b56f1..00c03f5 100644 --- a/typescript/src/decorateEditsForFileRename.ts +++ b/typescript/src/decorateEditsForFileRename.ts @@ -10,7 +10,7 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService, const predictedNameFromPath = (p: string) => { const input = p.split(/[/\\]/g).pop()!.replace(/\..+/, '') const transformed = camelCase(input) - + const isFirstUppercase = input && input.startsWith(input[0]!.toUpperCase()) return isFirstUppercase ? transformed[0]!.toUpperCase() + transformed.slice(1) : transformed } From e972f32dae16f912fbab2f8092d7cf497a47fc2f Mon Sep 17 00:00:00 2001 From: Vitaly Date: Wed, 17 Jan 2024 09:05:53 +0530 Subject: [PATCH 7/8] revert files warnings fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 84fbaec..9e9f1c4 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "watch-plugin": "node buildTsPlugin.mjs --watch", "build": "tsc && tsc -p typescript --noEmit && vscode-framework build && pnpm build-plugin", "build-plugin": "node buildTsPlugin.mjs && node buildTsPlugin.mjs --browser", - "lint": "eslint {src,typescript/src}", + "lint": "eslint {src/**,typescript/src/**}", "test": "pnpm test-plugin --run && pnpm integration-test", "test-plugin": "vitest --globals --dir typescript/test/ --environment ts-plugin", "integration-test": "node integration/prerun.mjs && tsc -p tsconfig.test.json && node testsOut/runTests.js", From 3dff0affef4b32baaffec5ce9c5e22103fab33fb Mon Sep 17 00:00:00 2001 From: Vitaly Date: Wed, 17 Jan 2024 09:26:08 +0530 Subject: [PATCH 8/8] fix critical mistake thx to tests --- typescript/src/completions/jsxAttributes.ts | 8 ++------ typescript/test/completions.spec.ts | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/typescript/src/completions/jsxAttributes.ts b/typescript/src/completions/jsxAttributes.ts index 727366b..976b821 100644 --- a/typescript/src/completions/jsxAttributes.ts +++ b/typescript/src/completions/jsxAttributes.ts @@ -37,12 +37,8 @@ export default ( jsxAttributeCandidate = true node = node.parent } - if (jsxAttributeCandidate) { - if ( - sharedCompletionContext.c('improveJsxCompletions') && - Object.keys(jsxCompletionsMap).length > 0 && - (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) - ) { + if (jsxAttributeCandidate && (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node))) { + if (sharedCompletionContext.c('improveJsxCompletions') && Object.keys(jsxCompletionsMap).length > 0) { const tagName = node.tagName.getText() // TODO use the same perf optimization for replaceSuggestions const patchEntries: Record = {} diff --git a/typescript/test/completions.spec.ts b/typescript/test/completions.spec.ts index 04b6a6d..6abcd2b 100644 --- a/typescript/test/completions.spec.ts +++ b/typescript/test/completions.spec.ts @@ -499,6 +499,7 @@ test('Case-sensetive completions', () => { test('Fix properties sorting', () => { overrideSettings({ fixSuggestionsSorting: true, + 'jsxAttributeShortcutCompletions.enable': 'disable', }) fourslashLikeTester(/* tsx */ ` let a: { @@ -613,6 +614,23 @@ test('Tuple signature', () => { }) }) +test('JSX attribute shortcut completions', () => { + const tester = fourslashLikeTester(/* tsx */ ` + const A = ({a, b}) => {} + const a = 5 + const c = + const d = + `) + tester.completion(1, { + exact: { + names: ['a', 'a={a}', 'b'], + }, + }) + tester.completion(2, { + excludes: ['a={a}'], + }) +}) + test('Object Literal Completions', () => { const [_positivePositions, _negativePositions, numPositions] = fileContentsSpecialPositions(/* ts */ ` interface Options {