eslint.config.mjs raw

   1  import eslint from "@eslint/js";
   2  import tsParser from "@typescript-eslint/parser";
   3  import eslintConfigPrettier from "eslint-config-prettier/flat";
   4  import reactHooks from "eslint-plugin-react-hooks";
   5  import reactRefresh from "eslint-plugin-react-refresh";
   6  import globals from "globals";
   7  import tseslint from "typescript-eslint";
   8  
   9  export default [
  10    {
  11      ignores: [
  12        "**/dist",
  13        "**/node_modules",
  14        "**/dist",
  15        "src/components/ui/navigation-menu.tsx",
  16      ],
  17    },
  18    eslint.configs.recommended,
  19    ...tseslint.configs.recommended,
  20    reactRefresh.configs.vite,
  21    reactHooks.configs.flat["recommended-latest"],
  22    eslintConfigPrettier,
  23    {
  24      languageOptions: {
  25        globals: {
  26          ...globals.browser,
  27        },
  28  
  29        parser: tsParser,
  30      },
  31      files: ["**/*.ts", "**/*.tsx"],
  32      rules: {
  33        "react-hooks/set-state-in-effect": "off",
  34        "@typescript-eslint/no-unused-vars": [
  35          "warn",
  36          {
  37            args: "none",
  38          },
  39        ],
  40  
  41        "no-console": [
  42          "error",
  43          {
  44            allow: ["info", "warn", "error"],
  45          },
  46        ],
  47  
  48        "no-constant-binary-expression": "error",
  49        curly: "error",
  50      },
  51    },
  52  ];
  53