mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-07 23:17:37 +00:00
103 lines
2.8 KiB
JavaScript
103 lines
2.8 KiB
JavaScript
import js from "@eslint/js";
|
|
import tseslint from "typescript-eslint";
|
|
import react from "eslint-plugin-react";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import importX from "eslint-plugin-import-x";
|
|
import tailwindcss from "eslint-plugin-tailwindcss";
|
|
import unusedImports from "eslint-plugin-unused-imports";
|
|
import globals from "globals";
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ["dist/**", "node_modules/**", "public/**"],
|
|
},
|
|
{
|
|
files: ["src/**/*.{ts,tsx,js,jsx}"],
|
|
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
plugins: {
|
|
react,
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
"import-x": importX,
|
|
tailwindcss,
|
|
"unused-imports": unusedImports,
|
|
},
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
},
|
|
parserOptions: {
|
|
ecmaFeatures: { jsx: true },
|
|
},
|
|
},
|
|
settings: {
|
|
react: { version: "detect" },
|
|
},
|
|
rules: {
|
|
// --- Unused imports/vars ---
|
|
"unused-imports/no-unused-imports": "warn",
|
|
"unused-imports/no-unused-vars": [
|
|
"warn",
|
|
{
|
|
vars: "all",
|
|
varsIgnorePattern: "^_",
|
|
args: "after-used",
|
|
argsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
"no-unused-vars": "off",
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
|
|
// --- React ---
|
|
"react/jsx-key": "warn",
|
|
"react/jsx-no-duplicate-props": "error",
|
|
"react/jsx-no-undef": "error",
|
|
"react/no-children-prop": "warn",
|
|
"react/no-danger-with-children": "error",
|
|
"react/no-direct-mutation-state": "error",
|
|
"react/no-unknown-property": "warn",
|
|
"react/react-in-jsx-scope": "off",
|
|
|
|
// --- React Hooks ---
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"react-hooks/exhaustive-deps": "warn",
|
|
|
|
// --- React Refresh (Vite HMR) ---
|
|
"react-refresh/only-export-components": [
|
|
"warn",
|
|
{ allowConstantExport: true },
|
|
],
|
|
|
|
// --- Import ordering & hygiene ---
|
|
"import-x/no-duplicates": "warn",
|
|
"import-x/order": [
|
|
"warn",
|
|
{
|
|
groups: [
|
|
"builtin",
|
|
"external",
|
|
"internal",
|
|
"parent",
|
|
"sibling",
|
|
"index",
|
|
],
|
|
"newlines-between": "never",
|
|
},
|
|
],
|
|
|
|
// --- Tailwind CSS ---
|
|
"tailwindcss/classnames-order": "warn",
|
|
"tailwindcss/no-contradicting-classname": "warn",
|
|
"tailwindcss/no-unnecessary-arbitrary-value": "warn",
|
|
|
|
// --- Disabled base rules ---
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"@typescript-eslint/no-require-imports": "off",
|
|
"no-case-declarations": "off",
|
|
"no-control-regex": "off",
|
|
"no-useless-escape": "off",
|
|
},
|
|
}
|
|
);
|