|
| 1 | +/** @type {import('eslint').Linter.Config[]} */ |
| 2 | +import js from "@eslint/js"; |
| 3 | +import eslintConfigPrettier from "eslint-config-prettier"; |
| 4 | +import prettierPlugin from "eslint-plugin-prettier"; |
| 5 | +import reactHooks from "eslint-plugin-react-hooks"; |
| 6 | +import reactRefresh from "eslint-plugin-react-refresh"; |
| 7 | +import globals from "globals"; |
| 8 | +import tseslint from "typescript-eslint"; |
| 9 | + |
| 10 | +export default tseslint.config( |
| 11 | + { ignores: ["dist", "node_modules"] }, |
| 12 | + { |
| 13 | + extends: [js.configs.recommended, ...tseslint.configs.recommended], |
| 14 | + files: ["**/*.{ts,tsx}"], |
| 15 | + languageOptions: { |
| 16 | + ecmaVersion: "latest", |
| 17 | + globals: globals.browser, |
| 18 | + }, |
| 19 | + plugins: { |
| 20 | + "react-hooks": reactHooks, |
| 21 | + "react-refresh": reactRefresh, |
| 22 | + prettier: prettierPlugin, |
| 23 | + }, |
| 24 | + rules: { |
| 25 | + ...reactHooks.configs.recommended.rules, |
| 26 | + "react-refresh/only-export-components": [ |
| 27 | + "warn", |
| 28 | + { allowConstantExport: true }, |
| 29 | + ], |
| 30 | + ...eslintConfigPrettier.rules, |
| 31 | + eqeqeq: ["error", "always"], |
| 32 | + "@typescript-eslint/no-explicit-any": "off", |
| 33 | + "@typescript-eslint/triple-slash-reference": "off", |
| 34 | + "@typescript-eslint/no-unused-vars": [ |
| 35 | + "error", |
| 36 | + { |
| 37 | + args: "all", |
| 38 | + argsIgnorePattern: "^_", |
| 39 | + caughtErrors: "all", |
| 40 | + caughtErrorsIgnorePattern: "^_", |
| 41 | + destructuredArrayIgnorePattern: "^_", |
| 42 | + varsIgnorePattern: "^_", |
| 43 | + ignoreRestSiblings: true, |
| 44 | + }, |
| 45 | + ], |
| 46 | + }, |
| 47 | + }, |
| 48 | +); |
0 commit comments