mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
3b06802423
next lint was removed in Next 16, so the demo's lint script failed before linting anything. Switch to eslint . with a flat eslint.config.mjs built on eslint-config-next's native flat exports (same shape as the other Next 16 example apps), and fix the findings the new react-hooks rules surfaced: - actions.ts / team/actions.ts: wrap mount fetches in an async IIFE so set-state-in-effect can see the setState calls are asynchronous - auth-context: derive currentUser from selection ?? team[0] instead of syncing state in an effect - use-theme: lazy-init theme from localStorage (SSR-guarded) and apply the DOM class in an effect keyed on theme; hoist applyTheme to module scope - threads-drawer: copy timeout maps to locals inside the effect so cleanup does not read refs that may have changed
21 lines
416 B
JavaScript
21 lines
416 B
JavaScript
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
|
|
import nextTypescript from "eslint-config-next/typescript";
|
|
|
|
const eslintConfig = [
|
|
...nextCoreWebVitals,
|
|
...nextTypescript,
|
|
{
|
|
ignores: [
|
|
"node_modules/**",
|
|
".next/**",
|
|
"out/**",
|
|
"build/**",
|
|
"next-env.d.ts",
|
|
"playwright-report/**",
|
|
"test-results/**",
|
|
],
|
|
},
|
|
];
|
|
|
|
export default eslintConfig;
|