Skip to content

Commit f59f8b4

Browse files
committed
chore: add eslint flat config + lint script
1 parent 39febd3 commit f59f8b4

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

app/components/ui/Navbar.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ export const Navigation: FC<NavigationProps> = ({ sticky = true }) => {
2626
const [open, setOpen] = useState(false);
2727
// const [solutionsOpen, setSolutionsOpen] = useState(false)
2828

29-
if (anyRouteStartsWith(siteConfig.chatgptPages, pathname)) {
30-
return null;
31-
}
29+
const shouldHideNavigation = anyRouteStartsWith(siteConfig.chatgptPages, pathname);
3230

3331
useEffect(() => {
32+
if (shouldHideNavigation) {
33+
return;
34+
}
35+
3436
const mediaQuery: MediaQueryList = window.matchMedia("(min-width: 768px)");
3537
const handleMediaQueryChange = () => {
3638
setOpen(false);
@@ -43,7 +45,11 @@ export const Navigation: FC<NavigationProps> = ({ sticky = true }) => {
4345
return () => {
4446
mediaQuery.removeEventListener("change", handleMediaQueryChange);
4547
};
46-
}, []);
48+
}, [shouldHideNavigation]);
49+
50+
if (shouldHideNavigation) {
51+
return null;
52+
}
4753

4854
return (
4955
<header

bun.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
2+
3+
export default [
4+
{
5+
ignores: ["**/.next/**", "**/node_modules/**", "**/.smoke/**"],
6+
},
7+
...nextCoreWebVitals,
8+
{
9+
rules: {
10+
// Avoid upgrade churn from React Compiler-related rules.
11+
"react-hooks/preserve-manual-memoization": "off",
12+
"react-hooks/purity": "off",
13+
"react-hooks/static-components": "off",
14+
"react-hooks/set-state-in-effect": "off",
15+
},
16+
},
17+
];
18+
19+

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"scripts": {
1818
"dev": "next dev",
1919
"build": "next build",
20-
"start": "next start"
20+
"start": "next start",
21+
"lint": "eslint app"
2122
},
2223
"dependencies": {
2324
"@mdx-js/loader": "^3.1.1",
@@ -48,7 +49,7 @@
4849
"recharts": "^3.5.1",
4950
"tailwind-merge": "^2.6.0",
5051
"tailwind-variants": "^0.3.1",
51-
"zod": "3.24.2"
52+
"zod": "^4.0.0"
5253
},
5354
"devDependencies": {
5455
"@next/bundle-analyzer": "^16.0.7",

0 commit comments

Comments
 (0)