Skip to content

Commit 62b234f

Browse files
Added react to lint plugins (#3255)
1 parent 7c78467 commit 62b234f

6 files changed

Lines changed: 15 additions & 6 deletions

File tree

.oxlintrc.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
3-
"plugins": ["eslint", "typescript", "unicorn", "oxc", "import"],
3+
"plugins": [
4+
"eslint",
5+
"typescript",
6+
"unicorn",
7+
"oxc",
8+
"import",
9+
"react",
10+
"react-perf"
11+
],
412
"jsPlugins": [
513
{
614
"name": "mocha",

packages/app-web-docs/src/docs/components/DynamicTOC.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function DynamicTOC({
2525
} else {
2626
row.appendChild(toc);
2727
}
28-
}, []);
28+
}, [minHeadingLevel, maxHeadingLevel]);
2929

3030
return null;
3131
}

packages/app-web-docs/src/docs/components/ScrollToHashId.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export function ScrollToHashId() {
3333

3434
setTimeout(scrollToId, delay);
3535
}
36+
// oxlint-disable-next-line eslint-plugin-react-hooks/exhaustive-deps
3637
}, []);
3738

3839
return null;

packages/lib-cheatsheet/src/lib/utils/useIsHighlighted.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const useHash = () => {
2929
return () => {
3030
window.removeEventListener("hashchange", onHashChange);
3131
};
32-
}, []);
32+
}, [onHashChange]);
3333

3434
return hash;
3535
};

packages/lib-vscode-tutorial-webview/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function App({ vscode }: Props) {
2121
);
2222

2323
vscode.postMessage({ type: "getInitialState" });
24-
}, []);
24+
}, [vscode]);
2525

2626
if (state == null) {
2727
// Just show nothing while we're waiting for initial state

packages/lib-vscode-tutorial-webview/src/TutorialStep.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export function TutorialStep({ state, vscode }: Props) {
5555
case "string":
5656
return <span key={j}>{fragment.value}</span>;
5757
case "command":
58-
return <Command spokenForm={fragment.value} />;
58+
return <Command key={j} spokenForm={fragment.value} />;
5959
case "term":
60-
return <span>"{fragment.value}"</span>;
60+
return <span key={j}>"{fragment.value}"</span>;
6161
default: {
6262
// Ensure we handle all cases
6363
const _unused: never = fragment;

0 commit comments

Comments
 (0)