web: migrate eslint to flat config, replacing removed next lint
This commit is contained in:
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "next/core-web-vitals"
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
ignores: [".next/**", "node_modules/**", "src/gql/**", "next-env.d.ts"],
|
||||||
|
},
|
||||||
|
...nextCoreWebVitals,
|
||||||
|
];
|
||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"lint": "eslint .",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"codegen": "graphql-codegen",
|
"codegen": "graphql-codegen",
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export const Header = () => {
|
|||||||
|
|
||||||
// hide menu on path change
|
// hide menu on path change
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// eslint-disable-next-line react-hooks/set-state-in-effect -- intentional: close the menu when navigation changes the path
|
||||||
setShowMenu(false);
|
setShowMenu(false);
|
||||||
}, [pathname]);
|
}, [pathname]);
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export function SearchShell({
|
|||||||
const [inputValue, setInputValue] = useState(initialQuery);
|
const [inputValue, setInputValue] = useState(initialQuery);
|
||||||
const [isPending, startTransition] = useTransition();
|
const [isPending, startTransition] = useTransition();
|
||||||
const lastPushedRef = useRef(initialQuery);
|
const lastPushedRef = useRef(initialQuery);
|
||||||
|
// eslint-disable-next-line react-hooks/refs -- deliberate: compares against the last debounced push; a stale read only briefly extends the spinner
|
||||||
const fetching = isPending || inputValue !== lastPushedRef.current;
|
const fetching = isPending || inputValue !== lastPushedRef.current;
|
||||||
|
|
||||||
const pushQuery = useDebouncedCallback((next: string) => {
|
const pushQuery = useDebouncedCallback((next: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user