Skip to content

Commit 1c8d05d

Browse files
authored
updates version update (#447)
* updates version update * updates eslint * split lint * bad true
1 parent e71e550 commit 1c8d05d

File tree

8 files changed

+76
-51
lines changed

8 files changed

+76
-51
lines changed

.github/workflows/pr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ jobs:
2121
- name: Setup repo
2222
uses: ./.github/actions
2323

24-
- name: prChecks
25-
run: pnpm prChecks
24+
- name: prBuild
25+
run: pnpm prBuild
26+
- name: prLint
27+
run: pnpm prLint || true
2628

2729
compatibility:
2830
needs: core

eslint.config.mjs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
import { dirname } from "path";
2-
import { fileURLToPath } from "url";
3-
import { FlatCompat } from "@eslint/eslintrc";
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import nextVitals from "eslint-config-next/core-web-vitals";
3+
import nextTs from "eslint-config-next/typescript";
44

5-
const __filename = fileURLToPath(import.meta.url);
6-
const __dirname = dirname(__filename);
5+
export default defineConfig([
6+
// Next.js recommended rules + React + React Hooks + Core Web Vitals
7+
...nextVitals,
78

8-
const compat = new FlatCompat({
9-
baseDirectory: __dirname,
10-
});
9+
// TypeScript rules from eslint-config-next
10+
...nextTs,
1111

12-
const eslintConfig = [
13-
...compat.extends("next/core-web-vitals", "next/typescript"),
12+
// Overrides
1413
{
1514
rules: {
1615
"@typescript-eslint/no-unused-vars": "off",
17-
"no-unused-vars": "off",
1816
"@typescript-eslint/no-explicit-any": "off",
19-
'react-hooks/exhaustive-deps': 'off',
20-
}
21-
}
22-
];
17+
"react-hooks/exhaustive-deps": "off",
18+
},
19+
},
2320

24-
export default eslintConfig;
21+
// Override default ignores
22+
globalIgnores([
23+
".next/**",
24+
"out/**",
25+
"build/**",
26+
"next-env.d.ts",
27+
]),
28+
]);

next.config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ const nextConfig = {
1515
images: {
1616
unoptimized: true,
1717
},
18-
eslint: {
19-
// Warning: This allows production builds to successfully complete even if
20-
// your project has ESLint errors.
21-
ignoreDuringBuilds: true,
22-
},
2318
// Turbopack config for dev mode
2419
turbopack: {
2520
rules: {

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@
3434
"private": true,
3535
"packageManager": "[email protected]",
3636
"scripts": {
37-
"prChecks": "pnpm lint && pnpm buildRepo",
37+
"prBuild": "pnpm buildRepo",
38+
"prLint": "pnpm lint",
3839
"dev": "next dev",
3940
"buildRepo": "pnpm rmBuild && pnpm build",
4041
"rmBuild": "pnpm -r exec rm -rf out",
4142
"build": "next build",
4243
"start": "next start",
4344
"test": "vitest",
4445
"test:coverage": "vitest run --coverage",
45-
"lint": "next lint --max-warnings 100"
46+
"lint": "eslint . --max-warnings=100"
4647
},
4748
"dependencies": {
4849
"@ffmpeg/ffmpeg": "^0.12.15",
@@ -69,7 +70,7 @@
6970
"gsap": "^3.13.0",
7071
"js-colormaps-es": "^0.0.5",
7172
"lucide-react": "^0.543.0",
72-
"next": "15.5.2",
73+
"next": ">=15.5.7",
7374
"next-themes": "^0.4.6",
7475
"radix-ui": "latest",
7576
"react": "^19.0.0",
@@ -95,7 +96,8 @@
9596
"@vitejs/plugin-react": "^4.4.1",
9697
"@vitest/coverage-v8": "^3.2.4",
9798
"eslint": "^9",
98-
"eslint-config-next": "15.4.3",
99+
"eslint-config-next": "^16.0.7",
100+
"eslint-plugin-next": "^0.0.0",
99101
"jsdom": "^26.1.0",
100102
"raw-loader": "^4.0.2",
101103
"tailwindcss": "^4",

src/components/ui/MainPanel/Dataset.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ const Dataset = ({setOpenVariables} : {setOpenVariables: React.Dispatch<React.Se
116116
const ua = navigator.userAgent;
117117
const vendor = (navigator as any).vendor || '';
118118
const isSafariDetected = /safari/i.test(ua) && !/chrome|crios|android|fxios|edg/i.test(ua) && /apple/i.test(vendor);
119-
setIsSafari(isSafariDetected);
119+
setTimeout(() => {
120+
setIsSafari(isSafariDetected);
121+
}, 0);
120122
}
121123
}, []);
122124

src/components/ui/ThemeSwitch.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ const ThemeSwitch = () => {
2525
}
2626
// useEffect only runs on the client, so now we can safely show the UI
2727
useEffect(() => {
28-
setMounted(true)
29-
}, [])
28+
setTimeout(() => {
29+
setMounted(true);
30+
}, 0);
31+
}, []);
3032

3133
const current = mounted ? (theme ?? resolvedTheme) : undefined
3234

src/components/ui/VersionSelector.tsx

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,23 @@ const VersionSelector = () => {
1111
const [versions, setVersions] = useState<string[]>([]);
1212
const [selectedVersion, setSelectedVersion] = useState<string | null>(null);
1313
const [isOpen, setIsOpen] = useState<boolean>(false);
14+
const [redirectUrl, setRedirectUrl] = useState<string | null>(null);
1415

1516
useEffect(() => {
1617
const { hostname, pathname, origin } = window.location;
1718
const pathSegments = pathname.split("/").filter(Boolean);
1819

1920
const isGitHubPages = hostname.endsWith("github.io");
20-
const isLocalhost =
21-
hostname === "localhost" || hostname.startsWith("10.");
21+
const isLocalhost = hostname === "localhost" || hostname.startsWith("10.");
2222

23-
const repoBase =
24-
isGitHubPages && pathSegments.length ? `/${pathSegments[0]}` : "";
23+
const repoBase = isGitHubPages && pathSegments.length ? `/${pathSegments[0]}` : "";
2524

2625
// dev mode: no versions.json
2726
if (isLocalhost) {
28-
setVersions(["latest"]);
29-
setSelectedVersion("latest");
27+
setTimeout(() => {
28+
setVersions(["latest"]);
29+
setSelectedVersion("latest");
30+
}, 0);
3031
return;
3132
}
3233

@@ -73,16 +74,16 @@ const VersionSelector = () => {
7374
const pathSegments = pathname.split("/").filter(Boolean);
7475

7576
const isGitHubPages = hostname.endsWith("github.io");
76-
const repoBase =
77-
isGitHubPages && pathSegments.length ? `/${pathSegments[0]}` : "";
78-
79-
// Always use /latest/ for latest, regardless of domain
80-
if (version === "latest") {
81-
window.location.href = `${repoBase}/latest/`;
82-
} else {
83-
window.location.href = `${repoBase}/${version}/`;
84-
}
77+
const repoBase = isGitHubPages && pathSegments.length ? `/${pathSegments[0]}` : "";
78+
79+
const targetUrl = version === "latest" ? `${repoBase}/latest/` : `${repoBase}/${version}/`;
80+
setRedirectUrl(targetUrl);
8581
};
82+
useEffect(() => {
83+
if (redirectUrl) {
84+
window.location.href = redirectUrl;
85+
}
86+
}, [redirectUrl]);
8687

8788
if (!versions.length || !selectedVersion) return null;
8889

tsconfig.json

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"compilerOptions": {
33
"target": "ES2017",
4-
"lib": ["dom", "dom.iterable", "esnext"],
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
59
"allowJs": true,
610
"skipLibCheck": true,
711
"strict": true,
@@ -11,7 +15,7 @@
1115
"moduleResolution": "bundler",
1216
"resolveJsonModule": true,
1317
"isolatedModules": true,
14-
"jsx": "preserve",
18+
"jsx": "react-jsx",
1519
"incremental": true,
1620
"plugins": [
1721
{
@@ -20,10 +24,23 @@
2024
],
2125
"baseUrl": ".",
2226
"paths": {
23-
"@/*": ["src/*"],
24-
"@/components/*": ["src/components/*"]
27+
"@/*": [
28+
"src/*"
29+
],
30+
"@/components/*": [
31+
"src/components/*"
32+
]
2533
}
2634
},
27-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "next.config.ts"],
28-
"exclude": ["node_modules"]
35+
"include": [
36+
"next-env.d.ts",
37+
"**/*.ts",
38+
"**/*.tsx",
39+
".next/types/**/*.ts",
40+
"next.config.ts",
41+
".next/dev/types/**/*.ts"
42+
],
43+
"exclude": [
44+
"node_modules"
45+
]
2946
}

0 commit comments

Comments
 (0)