From bf5f3d21153d8162cfbe87f741a88c39d655d3fc Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 25 Mar 2026 18:06:52 +0100 Subject: [PATCH 1/2] Added react to lint plugins --- .oxlintrc.json | 10 +++++++++- .../app-web-docs/src/docs/components/DynamicTOC.tsx | 2 +- .../src/docs/components/ScrollToHashId.tsx | 2 +- .../lib-cheatsheet/src/lib/utils/useIsHighlighted.ts | 2 +- packages/lib-vscode-tutorial-webview/src/App.tsx | 2 +- .../lib-vscode-tutorial-webview/src/TutorialStep.tsx | 4 ++-- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 1f94a614e6..9388ec771d 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,6 +1,14 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", - "plugins": ["eslint", "typescript", "unicorn", "oxc", "import"], + "plugins": [ + "eslint", + "typescript", + "unicorn", + "oxc", + "import", + "react", + "react-perf" + ], "jsPlugins": [ { "name": "mocha", diff --git a/packages/app-web-docs/src/docs/components/DynamicTOC.tsx b/packages/app-web-docs/src/docs/components/DynamicTOC.tsx index af7c50d162..9140b267fe 100644 --- a/packages/app-web-docs/src/docs/components/DynamicTOC.tsx +++ b/packages/app-web-docs/src/docs/components/DynamicTOC.tsx @@ -25,7 +25,7 @@ export function DynamicTOC({ } else { row.appendChild(toc); } - }, []); + }, [minHeadingLevel, maxHeadingLevel]); return null; } diff --git a/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx b/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx index 6f1219e55e..18c58d0f5d 100644 --- a/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx +++ b/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx @@ -33,7 +33,7 @@ export function ScrollToHashId() { setTimeout(scrollToId, delay); } - }, []); + }, [location.hash]); return null; } diff --git a/packages/lib-cheatsheet/src/lib/utils/useIsHighlighted.ts b/packages/lib-cheatsheet/src/lib/utils/useIsHighlighted.ts index a849ecba3f..feb8aebea1 100644 --- a/packages/lib-cheatsheet/src/lib/utils/useIsHighlighted.ts +++ b/packages/lib-cheatsheet/src/lib/utils/useIsHighlighted.ts @@ -29,7 +29,7 @@ const useHash = () => { return () => { window.removeEventListener("hashchange", onHashChange); }; - }, []); + }, [onHashChange]); return hash; }; diff --git a/packages/lib-vscode-tutorial-webview/src/App.tsx b/packages/lib-vscode-tutorial-webview/src/App.tsx index 5fb2e025da..4d8ffc03f1 100644 --- a/packages/lib-vscode-tutorial-webview/src/App.tsx +++ b/packages/lib-vscode-tutorial-webview/src/App.tsx @@ -21,7 +21,7 @@ export function App({ vscode }: Props) { ); vscode.postMessage({ type: "getInitialState" }); - }, []); + }, [vscode]); if (state == null) { // Just show nothing while we're waiting for initial state diff --git a/packages/lib-vscode-tutorial-webview/src/TutorialStep.tsx b/packages/lib-vscode-tutorial-webview/src/TutorialStep.tsx index 01d7c0bc0e..1394d6a952 100644 --- a/packages/lib-vscode-tutorial-webview/src/TutorialStep.tsx +++ b/packages/lib-vscode-tutorial-webview/src/TutorialStep.tsx @@ -55,9 +55,9 @@ export function TutorialStep({ state, vscode }: Props) { case "string": return {fragment.value}; case "command": - return ; + return ; case "term": - return "{fragment.value}"; + return "{fragment.value}"; default: { // Ensure we handle all cases const _unused: never = fragment; From 1b9c184b022eec7707ee4de5c02c57a4c9944a63 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 25 Mar 2026 18:15:52 +0100 Subject: [PATCH 2/2] Small fix --- packages/app-web-docs/src/docs/components/ScrollToHashId.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx b/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx index 18c58d0f5d..8ef34f5579 100644 --- a/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx +++ b/packages/app-web-docs/src/docs/components/ScrollToHashId.tsx @@ -33,7 +33,8 @@ export function ScrollToHashId() { setTimeout(scrollToId, delay); } - }, [location.hash]); + // oxlint-disable-next-line eslint-plugin-react-hooks/exhaustive-deps + }, []); return null; }