diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 8f4ed9d..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": ["next/core-web-vitals", "next/typescript"], - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "env": { - "browser": true, - "es2021": true, - "node": true, - "jest": true - }, - "rules": {}, - "ignorePatterns": [ - "node_modules/", - ".next/", - "out/", - "build/", - "dist/", - "coverage/", - "*.config.js", - "*.config.mjs" - ] -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..a7bffc9 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,57 @@ +import js from '@eslint/js'; +import typescriptPlugin from '@typescript-eslint/eslint-plugin'; +import typescriptParser from '@typescript-eslint/parser'; + +export default [ + js.configs.recommended, + { + files: ['**/*.{js,jsx,ts,tsx}'], + plugins: { + '@typescript-eslint': typescriptPlugin, + }, + languageOptions: { + parser: typescriptParser, + parserOptions: { + ecmaVersion: 2020, + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, + globals: { + React: 'readonly', + JSX: 'readonly', + NodeJS: 'readonly', + console: 'readonly', + process: 'readonly', + __dirname: 'readonly', + __filename: 'readonly', + module: 'readonly', + require: 'readonly', + exports: 'readonly', + document: 'readonly', + window: 'readonly', + navigator: 'readonly', + fetch: 'readonly', + }, + }, + rules: { + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], + 'no-undef': 'off', // TypeScript handles this + }, + }, + { + ignores: [ + 'node_modules/**', + '.next/**', + 'out/**', + 'build/**', + 'dist/**', + 'coverage/**', + '*.config.js', + '*.config.mjs', + 'jest.config.js', + ], + }, +]; diff --git a/package-lock.json b/package-lock.json index 806eb61..9e5e910 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,8 @@ "shiki": "^3.20.0" }, "devDependencies": { + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@tailwindcss/postcss": "^4.1.18", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^14.3.1", @@ -29,6 +31,8 @@ "@types/node": "^20.19.27", "@types/react": "^18.3.27", "@types/react-dom": "^18.3.7", + "@typescript-eslint/eslint-plugin": "^8.50.1", + "@typescript-eslint/parser": "^8.50.1", "autoprefixer": "^10.4.23", "eslint": "^9.15.0", "eslint-config-next": "^16.1.1", diff --git a/package.json b/package.json index 7c245d9..308617e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "next build", "build:search": "tsx scripts/build-search-index.ts", "start": "next start", - "lint": "next lint", + "lint": "eslint .", "format": "prettier --write \"**/*.{js,jsx,ts,tsx,md,mdx,json,css}\"", "typecheck": "tsc --noEmit", "test": "jest --passWithNoTests", @@ -28,6 +28,8 @@ "shiki": "^3.20.0" }, "devDependencies": { + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@tailwindcss/postcss": "^4.1.18", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^14.3.1", @@ -37,6 +39,8 @@ "@types/node": "^20.19.27", "@types/react": "^18.3.27", "@types/react-dom": "^18.3.7", + "@typescript-eslint/eslint-plugin": "^8.50.1", + "@typescript-eslint/parser": "^8.50.1", "autoprefixer": "^10.4.23", "eslint": "^9.15.0", "eslint-config-next": "^16.1.1", diff --git a/src/app/docs/[...slug]/page.tsx b/src/app/docs/[...slug]/page.tsx index 1b35537..d6125dd 100644 --- a/src/app/docs/[...slug]/page.tsx +++ b/src/app/docs/[...slug]/page.tsx @@ -115,7 +115,7 @@ export default async function DocPage({ params }: PageProps) { null, - h2: ({ node, ...props }: any) =>

, - h3: ({ node, ...props }: any) =>

, - h4: ({ node, ...props }: any) =>

, - h5: ({ node, ...props }: any) =>

, - h6: ({ node, ...props }: any) =>
, - p: ({ node, ...props }: any) =>

, - ul: ({ node, ...props }: any) =>