Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .eslintrc.json

This file was deleted.

6 changes: 5 additions & 1 deletion app/knowledge/guides/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ const mdxComponents = {
},
pre: ({ children }: React.HTMLAttributes<HTMLPreElement>) => {
// Extract language from code element if present
const codeElement = children as React.ReactElement;
// React 19 typed ReactElement['props'] as unknown; annotate the shape we read.
const codeElement = children as React.ReactElement<{
className?: string;
children?: React.ReactNode;
}>;
const className = codeElement?.props?.className || '';
const language = className.replace('language-', '');

Expand Down
4 changes: 3 additions & 1 deletion components/blog/MDXComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ const Img = (

// Extract slug from URL if not provided directly
useEffect(() => {
if (!src) {
// React 19 widened ImgHTMLAttributes['src'] to string | Blob; MDX only ever
// passes string paths, so narrow before the string operations below.
if (!src || typeof src !== 'string') {
console.info('Image source missing');
setIsError(true);
return;
Expand Down
4 changes: 3 additions & 1 deletion components/blog/ServerMDXContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ export default function ServerMDXContent({ content, slug }: ServerMDXContentProp
img: (imgProps: React.ImgHTMLAttributes<HTMLImageElement>) => {
const { src, alt } = imgProps;

if (!src) {
// React 19 widened ImgHTMLAttributes['src'] to string | Blob; MDX only ever
// passes string paths, so narrow before the string operations below.
if (!src || typeof src !== 'string') {
return <span className="block my-8 p-4 bg-red-50 text-red-500">Image source missing</span>;
}

Expand Down
2 changes: 1 addition & 1 deletion components/documents/ChatMessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface ChatMessageListProps {
messages: ChatMessage[];
loading: boolean;
selectedDocId: string | null;
chatEndRef: RefObject<HTMLDivElement>;
chatEndRef: RefObject<HTMLDivElement | null>;
}

export const ChatMessageList = ({
Expand Down
61 changes: 61 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import nextCoreWebVitals from 'eslint-config-next/core-web-vitals';
import nextTypeScript from 'eslint-config-next/typescript';
import eslintConfigPrettier from 'eslint-config-prettier';

// ESLint 9 flat config. eslint-config-next 16 ships native flat configs, so we
// compose them directly instead of wrapping legacy .eslintrc via FlatCompat
// (which crashes on the react plugin's circular flat-config object). Rule set is
// carried over verbatim from the previous .eslintrc.json.
const eslintConfig = [
{
ignores: [
'node_modules/',
'.next/',
'next-env.d.ts',
'dist/',
'build/',
'coverage/',
'*.config.js',
'*.config.mjs',
'healthcheck.js',
'scripts/',
],
},
...nextCoreWebVitals,
...nextTypeScript,
// Must come after the configs it disables formatting rules from.
eslintConfigPrettier,
{
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
// caughtErrors:'none' preserves the pre-upgrade contract — @typescript-eslint
// v8 flipped the default from 'none' to 'all', which would newly flag every
// unused `catch (err)` binding. Not a real regression; keep prior behaviour.
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrors: 'none' },
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-require-imports': 'off',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
'prefer-const': 'error',
'no-var': 'error',
'react/no-unescaped-entities': 'off',
'react/display-name': 'off',
'@next/next/no-img-element': 'warn',
// eslint-plugin-react-hooks v6 (bundled with Next 16's eslint-config-next)
// adds React-Compiler-era rules that did not exist in the Next 15 config and
// flag pre-existing intentional patterns (localStorage hydration, load-on-mount
// effects). Adopting them is a dedicated refactor, out of scope for this
// framework upgrade — deferred, tracked as follow-up. rules-of-hooks and
// exhaustive-deps stay enabled.
'react-hooks/set-state-in-effect': 'off',
'react-hooks/error-boundaries': 'off',
'react-hooks/immutability': 'off',
},
},
];

export default eslintConfig;
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import "./.next/types/routes.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
5 changes: 2 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ const nextConfig = {
],
},
serverExternalPackages: ['onnxruntime-node', '@xenova/transformers', 'sharp'],
experimental: {
typedRoutes: true,
},
// typedRoutes graduated from `experimental` to a stable top-level option in Next 16.
typedRoutes: true,
env: {
NEXT_PUBLIC_DEPLOY_TIME: new Date().toUTCString(),
},
Expand Down
Loading