chore(eslint): add eslint-plugin-react-compiler (#5918)

* chore(eslint): add `eslint-plugin-react-compiler`

* refactor: fix eslint warnings and avoid in-render mutations

---------

Co-authored-by: Slinetrac <realakayuki@gmail.com>
This commit is contained in:
Sukka
2025-12-22 12:51:20 +08:00
committed by GitHub
co-authored by Slinetrac
parent eafa08066d
commit 8e48e4ed10
8 changed files with 100 additions and 55 deletions
+5 -8
View File
@@ -62,18 +62,15 @@ export const useProxySelection = (options: ProxySelectionOptions = {}) => {
try {
if (current && !skipConfigSave) {
if (!current.selected) current.selected = [];
const index = current.selected.findIndex(
(item) => item.name === groupName,
);
const selected = current.selected ? [...current.selected] : [];
const index = selected.findIndex((item) => item.name === groupName);
if (index < 0) {
current.selected.push({ name: groupName, now: proxyName });
selected.push({ name: groupName, now: proxyName });
} else {
current.selected[index] = { name: groupName, now: proxyName };
selected[index] = { name: groupName, now: proxyName };
}
await patchCurrent({ selected: current.selected });
await patchCurrent({ selected });
}
await selectNodeForGroup(groupName, proxyName);