1- import { fixupConfigRules , fixupPluginRules } from "@eslint/compat" ;
2- import { FlatCompat } from "@eslint/eslintrc" ;
3- import js from "@eslint/js" ;
4- import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
1+ import eslint from "@eslint/js" ;
52import tsParser from "@typescript-eslint/parser" ;
3+ import eslintConfigPrettier from "eslint-config-prettier/flat" ;
4+ import reactHooks from "eslint-plugin-react-hooks" ;
65import reactRefresh from "eslint-plugin-react-refresh" ;
76import globals from "globals" ;
8- import path from "node:path" ;
9- import { fileURLToPath } from "node:url" ;
10- const __filename = fileURLToPath ( import . meta. url ) ;
11- const __dirname = path . dirname ( __filename ) ;
12-
13- const compat = new FlatCompat ( {
14- baseDirectory : __dirname ,
15- recommendedConfig : js . configs . recommended ,
16- allConfig : js . configs . all ,
17- } ) ;
7+ import tseslint from "typescript-eslint" ;
188
199export default [
2010 {
@@ -25,20 +15,12 @@ export default [
2515 "src/components/ui/navigation-menu.tsx" ,
2616 ] ,
2717 } ,
28- ...fixupConfigRules (
29- compat . extends (
30- "eslint:recommended" ,
31- "plugin:@typescript-eslint/recommended" ,
32- "plugin:react-hooks/recommended" ,
33- "prettier"
34- )
35- ) ,
18+ eslint . configs . recommended ,
19+ ...tseslint . configs . recommended ,
20+ reactRefresh . configs . vite ,
21+ reactHooks . configs . flat [ "recommended-latest" ] ,
22+ eslintConfigPrettier ,
3623 {
37- plugins : {
38- "react-refresh" : reactRefresh ,
39- "@typescript-eslint" : fixupPluginRules ( typescriptEslint ) ,
40- } ,
41-
4224 languageOptions : {
4325 globals : {
4426 ...globals . browser ,
@@ -48,20 +30,6 @@ export default [
4830 } ,
4931 files : [ "**/*.ts" , "**/*.tsx" ] ,
5032 rules : {
51- "react-refresh/only-export-components" : [
52- "warn" ,
53- {
54- allowConstantExport : true ,
55- } ,
56- ] ,
57-
58- "@typescript-eslint/ban-ts-comment" : [
59- "error" ,
60- {
61- "ts-ignore" : "allow-with-description" ,
62- } ,
63- ] ,
64-
6533 "@typescript-eslint/no-unused-vars" : [
6634 "warn" ,
6735 {
0 commit comments