Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions demo/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
// @ts-check
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import unicorn from "eslint-plugin-unicorn";
import { defineConfig, globalIgnores } from "eslint/config";
import globals from "globals";
import tseslint from "typescript-eslint";

const eslintConfig = tseslint.config(
{ ignores: ["dist"] },
const eslintConfig = defineConfig(
globalIgnores(["dist"]),
{
settings: { react: { version: "19" } },
extends: [js.configs.recommended, ...tseslint.configs.recommended],
settings: {
react: { version: "detect" },
},
extends: [
js.configs.recommended,
tseslint.configs.recommended,
unicorn.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
sourceType: "module",
parserOptions: {
project: ["./tsconfig.app.json", "./tsconfig.node.json"],
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
react,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...react.configs.recommended.rules,
Expand All @@ -32,12 +48,14 @@ const eslintConfig = tseslint.config(
disallowTypeAnnotations: true,
},
],
"@typescript-eslint/no-deprecated": "warn",
"react/prop-types": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"react/no-unescaped-entities": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/no-null": "off",
},
},
prettier
Expand Down
Loading
Loading