Files
react-template/eslint.config.js
T

45 lines
1.2 KiB
JavaScript
Raw Normal View History

2025-03-26 20:33:37 +08:00
import js from "@eslint/js"
import globals from "globals"
import reactHooks from "eslint-plugin-react-hooks"
import reactRefresh from "eslint-plugin-react-refresh"
import tseslint from "typescript-eslint"
import react from "eslint-plugin-react"
2025-03-26 19:06:46 +08:00
export default tseslint.config(
2025-03-26 20:33:37 +08:00
{ ignores: ["dist"] },
2025-03-26 19:06:46 +08:00
{
2025-03-26 20:33:37 +08:00
extends: [
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
files: ["**/*.{ts,tsx}"],
2025-03-26 19:06:46 +08:00
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
2025-03-26 20:33:37 +08:00
parserOptions: {
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
2025-03-26 19:06:46 +08:00
},
plugins: {
2025-03-26 20:33:37 +08:00
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
react,
2025-03-26 19:06:46 +08:00
},
rules: {
...reactHooks.configs.recommended.rules,
2025-03-26 20:33:37 +08:00
"react-refresh/only-export-components": [
"warn",
2025-03-26 19:06:46 +08:00
{ allowConstantExport: true },
],
2025-03-26 20:33:37 +08:00
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
"@typescript-eslint/no-unused-vars": 0
},
settings: {
2025-08-03 10:54:28 +08:00
react: { version: "19.1" },
2025-03-26 19:06:46 +08:00
},
},
)