From 5ebc7750ae569b7436e33485d139f66277e9cd1a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 01:49:13 +0000 Subject: [PATCH 1/2] chore(deps): update dependency eslint-plugin-svelte to v3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7d9ffddc..d12afc9a 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "eslint-plugin-node-dependencies": "^0.12.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-regexp": "^2.7.0", - "eslint-plugin-svelte": "^2.46.1", + "eslint-plugin-svelte": "^3.0.0", "eslint-plugin-yml": "^1.16.0", "globals": "^16.0.0", "locate-character": "^3.0.0", From ec3e669d331d08387382e89fcd58e31cea6b8375 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Thu, 27 Mar 2025 10:57:58 +0900 Subject: [PATCH 2/2] fix --- explorer-v2/src/lib/AstExplorer.svelte | 23 ++++---- explorer-v2/src/lib/ESLintPlayground.svelte | 23 ++++---- explorer-v2/src/lib/MonacoEditor.svelte | 33 ++++++------ explorer-v2/src/lib/ScopeExplorer.svelte | 23 ++++---- package.json | 58 ++++++++++----------- 5 files changed, 82 insertions(+), 78 deletions(-) diff --git a/explorer-v2/src/lib/AstExplorer.svelte b/explorer-v2/src/lib/AstExplorer.svelte index 66ff7746..53191731 100644 --- a/explorer-v2/src/lib/AstExplorer.svelte +++ b/explorer-v2/src/lib/AstExplorer.svelte @@ -29,19 +29,20 @@ ); let tsParser = undefined; + function setTSParser(parser) { + if (typeof window !== 'undefined') { + if (!window.process) { + window.process = { + cwd: () => '', + env: {} + }; + } + } + tsParser = parser; + } $: { if (hasLangTs && !tsParser) { - import('@typescript-eslint/parser').then((parser) => { - if (typeof window !== 'undefined') { - if (!window.process) { - window.process = { - cwd: () => '', - env: {} - }; - } - } - tsParser = parser; - }); + import('@typescript-eslint/parser').then(setTSParser); } } diff --git a/explorer-v2/src/lib/ESLintPlayground.svelte b/explorer-v2/src/lib/ESLintPlayground.svelte index 6905ab06..dacaa2d3 100644 --- a/explorer-v2/src/lib/ESLintPlayground.svelte +++ b/explorer-v2/src/lib/ESLintPlayground.svelte @@ -34,19 +34,20 @@ $: hasLangTs = /lang\s*=\s*(?:"ts"|ts|'ts'|"typescript"|typescript|'typescript')/u.test(code); let tsParser = undefined; + function setTSParser(parser) { + if (typeof window !== 'undefined') { + if (!window.process) { + window.process = { + cwd: () => '', + env: {} + }; + } + } + tsParser = parser; + } $: { if (hasLangTs && !tsParser) { - import('@typescript-eslint/parser').then((parser) => { - if (typeof window !== 'undefined') { - if (!window.process) { - window.process = { - cwd: () => '', - env: {} - }; - } - } - tsParser = parser; - }); + import('@typescript-eslint/parser').then(setTSParser); } } diff --git a/explorer-v2/src/lib/MonacoEditor.svelte b/explorer-v2/src/lib/MonacoEditor.svelte index 97246e99..3db6ffa5 100644 --- a/explorer-v2/src/lib/MonacoEditor.svelte +++ b/explorer-v2/src/lib/MonacoEditor.svelte @@ -54,22 +54,7 @@ $: { disposeCodeActionProvider(); if (provideCodeActions) { - loadingMonaco.then((monaco) => { - codeActionProviderDisposable = monaco.languages.registerCodeActionProvider(language, { - provideCodeActions(model, range, context) { - const editor = getLeftEditor?.(); - if (editor?.getModel().url !== model.url) { - return { - actions: [], - dispose() { - /* nop */ - } - }; - } - return provideCodeActions(model, range, context); - } - }); - }); + loadingMonaco.then((monaco) => setupCodeActionProvider(monaco, provideCodeActions)); } } @@ -216,6 +201,22 @@ } } + function setupCodeActionProvider(monaco, provideCodeActions) { + codeActionProviderDisposable = monaco.languages.registerCodeActionProvider(language, { + provideCodeActions(model, range, context) { + const editor = getLeftEditor?.(); + if (editor?.getModel().url !== model.url) { + return { + actions: [], + dispose() { + /* nop */ + } + }; + } + return provideCodeActions(model, range, context); + } + }); + } function disposeCodeActionProvider() { if (codeActionProviderDisposable) { codeActionProviderDisposable.dispose(); diff --git a/explorer-v2/src/lib/ScopeExplorer.svelte b/explorer-v2/src/lib/ScopeExplorer.svelte index ecf361f8..263661a9 100644 --- a/explorer-v2/src/lib/ScopeExplorer.svelte +++ b/explorer-v2/src/lib/ScopeExplorer.svelte @@ -28,19 +28,20 @@ svelteValue ); let tsParser = undefined; + function setTSParser(parser) { + if (typeof window !== 'undefined') { + if (!window.process) { + window.process = { + cwd: () => '', + env: {} + }; + } + } + tsParser = parser; + } $: { if (hasLangTs && !tsParser) { - import('@typescript-eslint/parser').then((parser) => { - if (typeof window !== 'undefined') { - if (!window.process) { - window.process = { - cwd: () => '', - env: {} - }; - } - } - tsParser = parser; - }); + import('@typescript-eslint/parser').then(setTSParser); } } $: { diff --git a/package.json b/package.json index d12afc9a..190eed0e 100644 --- a/package.json +++ b/package.json @@ -63,54 +63,54 @@ "postcss-selector-parser": "^7.0.0" }, "devDependencies": { - "@changesets/changelog-github": "^0.5.0", - "@changesets/cli": "^2.27.10", - "@changesets/get-release-plan": "^4.0.5", + "@changesets/changelog-github": "^0.5.1", + "@changesets/cli": "^2.28.1", + "@changesets/get-release-plan": "^4.0.8", "@ota-meshi/eslint-plugin": "^0.17.6", "@ota-meshi/test-snapshot": "^1.1.0", "@types/benchmark": "^2.1.5", - "@types/chai": "^5.0.0", + "@types/chai": "^5.2.1", "@types/eslint": "^9.6.1", "@types/eslint-scope": "^3.7.7", "@types/eslint-visitor-keys": "^3.3.2", - "@types/estree": "^1.0.6", + "@types/estree": "^1.0.7", "@types/mocha": "^10.0.10", - "@types/node": "^22.10.1", - "@types/semver": "^7.5.8", - "@typescript-eslint/eslint-plugin": "^8.16.0", + "@types/node": "^22.13.13", + "@types/semver": "^7.7.0", + "@typescript-eslint/eslint-plugin": "^8.28.0", "@typescript-eslint/parser": "~8.28.0", "@typescript-eslint/types": "~8.28.0", "benchmark": "^2.1.4", - "c8": "^10.1.2", - "chai": "^5.0.0", + "c8": "^10.1.3", + "chai": "^5.2.0", "env-cmd": "^10.1.0", - "esbuild": "^0.25.0", + "esbuild": "^0.25.1", "eslint": "~9.23.0", - "eslint-config-prettier": "^10.0.0", + "eslint-config-prettier": "^10.1.1", "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-jsdoc": "^50.6.0", - "eslint-plugin-json-schema-validator": "^5.2.0", - "eslint-plugin-jsonc": "^2.18.2", - "eslint-plugin-n": "^17.14.0", + "eslint-plugin-jsdoc": "^50.6.9", + "eslint-plugin-json-schema-validator": "^5.3.1", + "eslint-plugin-jsonc": "^2.20.0", + "eslint-plugin-n": "^17.17.0", "eslint-plugin-node-dependencies": "^0.12.0", - "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-prettier": "^5.2.5", "eslint-plugin-regexp": "^2.7.0", - "eslint-plugin-svelte": "^3.0.0", - "eslint-plugin-yml": "^1.16.0", + "eslint-plugin-svelte": "^3.3.3", + "eslint-plugin-yml": "^1.17.0", "globals": "^16.0.0", "locate-character": "^3.0.0", - "magic-string": "^0.30.14", - "mocha": "^11.0.0", - "prettier": "~3.5.0", + "magic-string": "^0.30.17", + "mocha": "^11.1.0", + "prettier": "~3.5.3", "prettier-plugin-pkg": "^0.18.1", - "prettier-plugin-svelte": "^3.3.2", + "prettier-plugin-svelte": "^3.3.3", "rimraf": "^6.0.1", - "semver": "^7.6.3", - "svelte": "^5.9.0", - "svelte2tsx": "^0.7.28", - "tsx": "^4.19.2", - "typescript": "~5.8.0", - "typescript-eslint": "^8.16.0", + "semver": "^7.7.1", + "svelte": "^5.25.3", + "svelte2tsx": "^0.7.35", + "tsx": "^4.19.3", + "typescript": "~5.8.2", + "typescript-eslint": "^8.28.0", "typescript-eslint-parser-for-extra-files": "^0.7.0" }, "publishConfig": {