|
| 1 | +import js from "@eslint/js"; |
| 2 | +import globals from "globals"; |
| 3 | +import prettierConfig from "eslint-config-prettier"; |
| 4 | +import react from "eslint-plugin-react"; |
| 5 | +import reactHooks from "eslint-plugin-react-hooks"; |
| 6 | +import reactRefresh from "eslint-plugin-react-refresh"; |
| 7 | +import tseslint from "typescript-eslint"; |
| 8 | + |
| 9 | +export default tseslint.config( |
| 10 | + { ignores: ["dist"] }, |
| 11 | + { |
| 12 | + extends: [ |
| 13 | + js.configs.recommended, |
| 14 | + ...tseslint.configs.strictTypeChecked, |
| 15 | + ...tseslint.configs.stylisticTypeChecked, |
| 16 | + prettierConfig, |
| 17 | + ], |
| 18 | + files: ["**/*.{ts,tsx}"], |
| 19 | + languageOptions: { |
| 20 | + ecmaVersion: 2020, |
| 21 | + globals: globals.browser, |
| 22 | + parserOptions: { |
| 23 | + project: ["./tsconfig.node.json", "./tsconfig.app.json"], |
| 24 | + tsconfigRootDir: import.meta.dirname, |
| 25 | + }, |
| 26 | + }, |
| 27 | + settings: { react: { version: "18.3.1" } }, |
| 28 | + plugins: { |
| 29 | + react, |
| 30 | + "react-hooks": reactHooks, |
| 31 | + "react-refresh": reactRefresh, |
| 32 | + }, |
| 33 | + rules: { |
| 34 | + ...reactHooks.configs.recommended.rules, |
| 35 | + "react-refresh/only-export-components": [ |
| 36 | + "warn", |
| 37 | + { allowConstantExport: true }, |
| 38 | + ], |
| 39 | + ...react.configs.recommended.rules, |
| 40 | + ...react.configs["jsx-runtime"].rules, |
| 41 | + }, |
| 42 | + }, |
| 43 | +); |
0 commit comments