Skip to content

Commit 205d375

Browse files
committed
fix(website): update ESLint config for Next.js 16
Next.js 16 removed the built-in lint command. Update to use ESLint 9 flat config directly with typescript-eslint and react plugins. - Replace `next lint` with `eslint .` in package.json - Update eslint.config.mjs to use native flat config - Remove eslint-config-next, add typescript-eslint and react plugins - Fix lint errors: empty interfaces, unused variables, removed rule
1 parent 103f2ae commit 205d375

6 files changed

Lines changed: 66 additions & 236 deletions

File tree

website/bun.lock

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

website/components/marketing/WorkflowVisualization.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ const centerVariants: Variants = {
103103
},
104104
};
105105

106-
const arrowVariants: Variants = {
106+
// Arrow variants for future animation use
107+
const _arrowVariants: Variants = {
107108
hidden: { opacity: 0, pathLength: 0 },
108109
visible: {
109110
opacity: 1,
@@ -119,7 +120,7 @@ const arrowVariants: Variants = {
119120
/**
120121
* Single workflow step card component.
121122
*/
122-
function WorkflowStepCard({ step, index }: { step: WorkflowStep; index: number }) {
123+
function WorkflowStepCard({ step, index: _index }: { step: WorkflowStep; index: number }) {
123124
const Icon = step.icon;
124125

125126
return (

website/components/ui/Card.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ interface CardProps extends HTMLAttributes<HTMLDivElement> {
1616
variant?: 'default' | 'elevated' | 'bordered';
1717
}
1818

19-
interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {}
20-
interface CardContentProps extends HTMLAttributes<HTMLDivElement> {}
21-
interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {}
19+
type CardHeaderProps = HTMLAttributes<HTMLDivElement>;
20+
type CardContentProps = HTMLAttributes<HTMLDivElement>;
21+
type CardFooterProps = HTMLAttributes<HTMLDivElement>;
2222

2323
/**
2424
* Base card styles - terminal window aesthetic with layered backgrounds.

website/eslint.config.mjs

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,55 @@
11
/**
22
* ABOUTME: ESLint configuration for the Ralph TUI website.
3-
* Uses Next.js recommended config with TypeScript support.
3+
* Uses TypeScript-ESLint for type-aware linting.
44
*/
55

6-
import { dirname } from 'path';
7-
import { fileURLToPath } from 'url';
8-
import { FlatCompat } from '@eslint/eslintrc';
6+
import eslint from '@eslint/js';
7+
import tseslint from 'typescript-eslint';
8+
import reactPlugin from 'eslint-plugin-react';
9+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
910

10-
const __filename = fileURLToPath(import.meta.url);
11-
const __dirname = dirname(__filename);
11+
export default tseslint.config(
12+
eslint.configs.recommended,
13+
...tseslint.configs.recommended,
14+
{
15+
files: ['**/*.{js,jsx,ts,tsx}'],
16+
plugins: {
17+
react: reactPlugin,
18+
'react-hooks': reactHooksPlugin,
19+
},
20+
languageOptions: {
21+
parserOptions: {
22+
ecmaFeatures: {
23+
jsx: true,
24+
},
25+
},
26+
},
27+
settings: {
28+
react: {
29+
version: 'detect',
30+
},
31+
},
32+
rules: {
33+
// React rules
34+
'react/react-in-jsx-scope': 'off', // Not needed with React 17+
35+
'react/prop-types': 'off', // Using TypeScript
36+
'react-hooks/rules-of-hooks': 'error',
37+
'react-hooks/exhaustive-deps': 'warn',
1238

13-
const compat = new FlatCompat({
14-
baseDirectory: __dirname,
15-
});
39+
// TypeScript rules
40+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
41+
'@typescript-eslint/no-explicit-any': 'warn',
1642

17-
const eslintConfig = [...compat.extends('next/core-web-vitals')];
18-
19-
export default eslintConfig;
43+
// General rules
44+
'no-console': ['warn', { allow: ['warn', 'error'] }],
45+
},
46+
},
47+
{
48+
ignores: [
49+
'.next/**',
50+
'node_modules/**',
51+
'out/**',
52+
'*.config.{js,mjs,ts}',
53+
],
54+
}
55+
);

website/mdx-components.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ function Td({ children, ...props }: React.HTMLAttributes<HTMLTableCellElement>)
346346
*/
347347
function Img(props: React.ImgHTMLAttributes<HTMLImageElement>) {
348348
return (
349-
// eslint-disable-next-line @next/next/no-img-element
350349
<img
351350
className={[
352351
'my-6 rounded-sm',

website/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dev": "next dev",
88
"build": "next build",
99
"start": "next start",
10-
"lint": "next lint",
10+
"lint": "eslint .",
1111
"typecheck": "tsc --noEmit"
1212
},
1313
"dependencies": {
@@ -32,16 +32,18 @@
3232
"tailwind-merge": "^3.0.0"
3333
},
3434
"devDependencies": {
35-
"@eslint/eslintrc": "^3.2.0",
35+
"@eslint/js": "^9.0.0",
3636
"@tailwindcss/postcss": "^4.1.0",
3737
"@tailwindcss/typography": "^0.5.16",
3838
"@types/mdx": "^2.0.13",
3939
"@types/node": "^22.0.0",
4040
"@types/react": "^19.0.0",
4141
"@types/react-dom": "^19.0.0",
4242
"eslint": "^9.0.0",
43-
"eslint-config-next": "^16.0.0",
43+
"eslint-plugin-react": "^7.37.0",
44+
"eslint-plugin-react-hooks": "^5.1.0",
4445
"tailwindcss": "^4.1.0",
45-
"typescript": "^5.7.0"
46+
"typescript": "^5.7.0",
47+
"typescript-eslint": "^8.0.0"
4648
}
4749
}

0 commit comments

Comments
 (0)