Skip to content

Commit 867c0d8

Browse files
authored
chore: Update all dependencies and add eslint-plugin-unicorn (#371)
1 parent 7434fd5 commit 867c0d8

File tree

10 files changed

+4230
-2904
lines changed

10 files changed

+4230
-2904
lines changed

demo/eslint.config.js

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
1+
// @ts-check
12
import js from "@eslint/js";
23
import prettier from "eslint-config-prettier";
34
import react from "eslint-plugin-react";
45
import reactHooks from "eslint-plugin-react-hooks";
56
import reactRefresh from "eslint-plugin-react-refresh";
7+
import unicorn from "eslint-plugin-unicorn";
8+
import { defineConfig, globalIgnores } from "eslint/config";
69
import globals from "globals";
710
import tseslint from "typescript-eslint";
811

9-
const eslintConfig = tseslint.config(
10-
{ ignores: ["dist"] },
12+
const eslintConfig = defineConfig(
13+
globalIgnores(["dist"]),
1114
{
12-
settings: { react: { version: "19" } },
13-
extends: [js.configs.recommended, ...tseslint.configs.recommended],
15+
settings: {
16+
react: { version: "detect" },
17+
},
18+
extends: [
19+
js.configs.recommended,
20+
tseslint.configs.recommended,
21+
unicorn.configs.recommended,
22+
reactHooks.configs.flat.recommended,
23+
reactRefresh.configs.vite,
24+
],
1425
files: ["**/*.{ts,tsx}"],
1526
languageOptions: {
1627
ecmaVersion: 2020,
1728
globals: globals.browser,
29+
sourceType: "module",
30+
parserOptions: {
31+
project: ["./tsconfig.app.json", "./tsconfig.node.json"],
32+
ecmaFeatures: {
33+
jsx: true,
34+
},
35+
},
1836
},
1937
plugins: {
2038
react,
21-
"react-hooks": reactHooks,
22-
"react-refresh": reactRefresh,
2339
},
2440
rules: {
2541
...react.configs.recommended.rules,
@@ -32,12 +48,14 @@ const eslintConfig = tseslint.config(
3248
disallowTypeAnnotations: true,
3349
},
3450
],
51+
"@typescript-eslint/no-deprecated": "warn",
3552
"react/prop-types": "off",
3653
"react-refresh/only-export-components": [
3754
"warn",
3855
{ allowConstantExport: true },
3956
],
40-
"react/no-unescaped-entities": "off",
57+
"unicorn/prevent-abbreviations": "off",
58+
"unicorn/no-null": "off",
4159
},
4260
},
4361
prettier

0 commit comments

Comments
 (0)