|
| 1 | +import js from "@eslint/js"; |
| 2 | +import { defineConfig, globalIgnores } from "eslint/config"; |
| 3 | +import react from "eslint-plugin-react"; |
| 4 | +import globals from "globals"; |
| 5 | +import reactHooks from "eslint-plugin-react-hooks"; |
| 6 | +import reactRefresh from "eslint-plugin-react-refresh"; |
| 7 | +import prettier from "eslint-config-prettier/flat"; |
| 8 | + |
| 9 | +export default defineConfig([ |
| 10 | + globalIgnores(["dist/"]), |
| 11 | + reactHooks.configs["recommended-latest"], |
| 12 | + reactRefresh.configs.vite, |
| 13 | + { |
| 14 | + plugins: { js, react }, |
| 15 | + files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"], |
| 16 | + extends: [js.configs.recommended], |
| 17 | + rules: { |
| 18 | + ...react.configs.recommended.rules, |
| 19 | + ...react.configs["jsx-runtime"].rules, |
| 20 | + "react-refresh/only-export-components": [ |
| 21 | + "warn", |
| 22 | + { allowConstantExport: true }, |
| 23 | + ], |
| 24 | + "react/prop-types": 0, |
| 25 | + }, |
| 26 | + settings: { react: { version: "18.2" } }, |
| 27 | + languageOptions: { |
| 28 | + parserOptions: { ecmaFeatures: { jsx: true } }, |
| 29 | + globals: { ...globals.browser, ...globals.es2020 }, |
| 30 | + }, |
| 31 | + }, |
| 32 | + { |
| 33 | + files: ["**/context/**/*.jsx", "**/context/**/*.tsx"], |
| 34 | + rules: { |
| 35 | + "react-refresh/only-export-components": "off", |
| 36 | + }, |
| 37 | + }, |
| 38 | + prettier, |
| 39 | +]); |
0 commit comments