diff --git a/.vscode/settings.json b/.vscode/settings.json index 4bb2352..042e58a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,6 @@ // ESLint settings "eslint.useFlatConfig": true, - "eslint.experimental.useFlatConfig": true, "eslint.format.enable": true, "eslint.nodePath": "website/node_modules", "eslint.validate": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 97a363f..7fb0cde 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -209,9 +209,6 @@ importers: eslint-plugin-import: specifier: ^2.32.0 version: 2.32.0(@typescript-eslint/parser@8.53.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.2(jiti@2.6.1)) - eslint-plugin-jsx-a11y: - specifier: ^6.10.2 - version: 6.10.2(eslint@9.39.2(jiti@2.6.1)) eslint-plugin-prettier: specifier: ^5.5.5 version: 5.5.5(eslint-config-prettier@10.1.8(eslint@9.39.2(jiti@2.6.1)))(eslint@9.39.2(jiti@2.6.1))(prettier@3.8.0) diff --git a/website/eslint.config.mjs b/website/eslint.config.mjs index 424b74f..11c0c02 100644 --- a/website/eslint.config.mjs +++ b/website/eslint.config.mjs @@ -1,96 +1,129 @@ import { FlatCompat } from "@eslint/eslintrc"; -import next from "@next/eslint-plugin-next"; +import { defineConfig, globalIgnores } from "eslint/config"; +import prettier from "eslint-config-prettier/flat"; import eslintPluginImport from "eslint-plugin-import"; import eslintPluginPrettier from "eslint-plugin-prettier"; -import eslintPluginReact from "eslint-plugin-react"; -import eslintPluginReactHooks from "eslint-plugin-react-hooks"; import tseslint from "typescript-eslint"; -import { defineConfig } from "eslint/config"; const compat = new FlatCompat({ baseDirectory: import.meta.dirname, }); export default defineConfig( + // Next.js Core Web Vitals config (includes React, React Hooks, and Next.js rules) + ...compat.extends("next/core-web-vitals", "next/typescript"), + + // Prettier config (disables conflicting ESLint rules) + prettier, + + // Global ignores + globalIgnores([ + // Default Next.js ignores + ".next/**", + "out/**", + "build/**", + "next-env.d.ts", + // Additional ignores + "public/_pagefind/**", + "node_modules/**", + ".git/**", + ]), + + // Custom rules and plugins { - ignores: ["**/.next/**", "**/public/_pagefind/**", "**/out/**"], - }, - ...compat.extends( - "plugin:react/recommended", - "plugin:react-hooks/recommended", - "prettier" - ), - { + files: ["**/*.{js,mjs,cjs,jsx,ts,tsx}"], plugins: { import: eslintPluginImport, - react: eslintPluginReact, - }, - rules: { - "import/no-anonymous-default-export": "warn", - "react/no-unknown-property": "off", - "react/react-in-jsx-scope": "off", - "react/prop-types": "off", - "jsx-a11y/alt-text": [ - "warn", - { - elements: ["img"], - img: ["Image"], - }, - ], - "jsx-a11y/aria-props": "warn", - "jsx-a11y/aria-proptypes": "warn", - "jsx-a11y/aria-unsupported-elements": "warn", - "jsx-a11y/role-has-required-aria-props": "warn", - "jsx-a11y/role-supports-aria-props": "warn", - "react/jsx-no-target-blank": "off", + prettier: eslintPluginPrettier, }, settings: { - react: { - version: "detect", + next: { + rootDir: import.meta.dirname, }, }, + rules: { + // Import rules + "import/no-anonymous-default-export": "warn", + "import/order": [ + "warn", + { + groups: [ + "builtin", + "external", + "internal", + "parent", + "sibling", + "index", + ], + "newlines-between": "never", + alphabetize: { + order: "asc", + caseInsensitive: true, + }, + }, + ], + + // React rules overrides + "react/no-unknown-property": "off", // For Three.js props + + // Prettier + "prettier/prettier": "warn", + }, }, + + // Additional TypeScript config { - files: ["**/*.ts", "**/*.tsx"], + files: ["**/*.{ts,tsx}"], extends: [ ...tseslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, ...tseslint.configs.stylisticTypeChecked, ], + languageOptions: { + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, rules: { + // TypeScript rules "@typescript-eslint/triple-slash-reference": "off", "@typescript-eslint/array-type": "off", "@typescript-eslint/consistent-type-definitions": "off", "@typescript-eslint/consistent-type-imports": [ "warn", - { prefer: "type-imports", fixStyle: "inline-type-imports" }, + { + prefer: "type-imports", + fixStyle: "inline-type-imports", + }, + ], + "@typescript-eslint/no-unused-vars": [ + "warn", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, ], - "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], "@typescript-eslint/require-await": "off", "@typescript-eslint/no-misused-promises": [ "error", - { checksVoidReturn: { attributes: false } }, + { + checksVoidReturn: { + attributes: false, + }, + }, ], "@typescript-eslint/prefer-nullish-coalescing": "off", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-unnecessary-condition": "warn", }, }, - { - files: ["**/*.{js,jsx,ts,tsx}"], - plugins: { - prettier: eslintPluginPrettier, - }, - rules: { - "prettier/prettier": "warn", - }, - }, + + // Linter options { linterOptions: { - reportUnusedDisableDirectives: true, + reportUnusedDisableDirectives: "warn", }, - languageOptions: { - parserOptions: { - projectService: true, - }, - }, - } + }, ); diff --git a/website/package.json b/website/package.json index 511b272..bae9452 100644 --- a/website/package.json +++ b/website/package.json @@ -86,7 +86,6 @@ "eslint-config-next": "^15.2.3", "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", - "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-prettier": "^5.5.5", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.0.1", diff --git a/website/src/components/home/hero-3d.tsx b/website/src/components/home/hero-3d.tsx index 5a59f58..33189c6 100644 --- a/website/src/components/home/hero-3d.tsx +++ b/website/src/components/home/hero-3d.tsx @@ -1,6 +1,5 @@ "use client"; -import { Canvas, useFrame } from "@react-three/fiber"; import { Sphere, MeshDistortMaterial, @@ -8,6 +7,7 @@ import { Stars, PerspectiveCamera, } from "@react-three/drei"; +import { Canvas, useFrame } from "@react-three/fiber"; import { useRef } from "react"; import type * as THREE from "three";