Skip to content

Commit

Permalink
style(eslint): disable prefer-arrow-callback
Browse files Browse the repository at this point in the history
  • Loading branch information
VdustR committed Aug 11, 2024
1 parent 9473907 commit 4bac81d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/eslint/rules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import type { TypedFlatConfigItem } from "@antfu/eslint-config";

const rules: NonNullable<TypedFlatConfigItem["rules"]> = {
/**
* Some callbacks are purposefully named to make the code self-documenting.
*/
"prefer-arrow-callback": "off",

/**
* Sort keys in JSON files.
*/
Expand Down
5 changes: 4 additions & 1 deletion packages/vite-react-19/src/TopBar/ModeSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ function ModeToggle() {
setMode(mode === "light" ? "dark" : "light");
});

useEffect(() => {
useEffect(function bindMounted() {
setMounted(true);
return function cleanup() {
setMounted(false);
};
}, []);
if (!mounted) return null;

Expand Down

0 comments on commit 4bac81d

Please sign in to comment.