1+ // @ts -check
12import js from "@eslint/js" ;
23import prettier from "eslint-config-prettier" ;
34import react from "eslint-plugin-react" ;
45import reactHooks from "eslint-plugin-react-hooks" ;
56import reactRefresh from "eslint-plugin-react-refresh" ;
7+ import unicorn from "eslint-plugin-unicorn" ;
8+ import { defineConfig , globalIgnores } from "eslint/config" ;
69import globals from "globals" ;
710import 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