aboutsummaryrefslogtreecommitdiff
path: root/eslint.config.js
blob: 88bae50c548ca936c328ab774c1fcd4b16f2da03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import js from "@eslint/js";
import ts from "typescript-eslint";
import react from "eslint-plugin-react";
import { defineConfig } from "eslint/config";
import reactHooks from "eslint-plugin-react-hooks";
import globals from "globals";

export default defineConfig(
  js.configs.recommended,
  ts.configs.recommended,
  {
    files: ["**/*.{ts,tsx}"],
    plugins: {
      react,
      "react-hooks": reactHooks,
    },
    languageOptions: {
      globals: {
        ...globals.browser,
      },
    },
    settings: {
      react: {
        version: "detect",
      },
    },
    rules: {
      ...react.configs.recommended.rules,
      ...react.configs["jsx-runtime"].rules,
      ...reactHooks.configs.recommended.rules,
      // Disable for React Three Fiber - it uses custom JSX properties
      "react/no-unknown-property": "off",
      // Using TypeScript for prop validation
      "react/prop-types": "off",
      // R3F requires mutating Three.js objects returned from useThree()
      "react-hooks/immutability": "off",
    },
  },
  {
    ignores: ["dist/"],
  },
);