1+ import react from "eslint-plugin-react" ;
2+ import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
3+ import jest from "eslint-plugin-jest" ;
4+ import globals from "globals" ;
5+ import tsParser from "@typescript-eslint/parser" ;
6+ import path from "node:path" ;
7+ import { fileURLToPath } from "node:url" ;
8+ import js from "@eslint/js" ;
9+ import { FlatCompat } from "@eslint/eslintrc" ;
10+
11+ const __filename = fileURLToPath ( import . meta. url ) ;
12+ const __dirname = path . dirname ( __filename ) ;
13+ const compat = new FlatCompat ( {
14+ baseDirectory : __dirname ,
15+ recommendedConfig : js . configs . recommended ,
16+ allConfig : js . configs . all
17+ } ) ;
18+
19+ export default [ ...compat . extends (
20+ "eslint:recommended" ,
21+ "plugin:react/recommended" ,
22+ "plugin:@typescript-eslint/recommended" ,
23+ "plugin:prettier/recommended" ,
24+ "plugin:jest/recommended" ,
25+ ) . map ( config => ( {
26+ ...config ,
27+ } ) ) , {
28+ plugins : {
29+ react,
30+ "@typescript-eslint" : typescriptEslint ,
31+ jest,
32+ } ,
33+
34+ languageOptions : {
35+ globals : {
36+ ...globals . browser ,
37+ ...globals . jest ,
38+ unlayer : "readonly" ,
39+ } ,
40+
41+ parser : tsParser ,
42+ ecmaVersion : 12 ,
43+ sourceType : "module" ,
44+
45+ parserOptions : {
46+ ecmaFeatures : {
47+ jsx : true ,
48+ } ,
49+ } ,
50+ } ,
51+
52+ settings : {
53+ react : {
54+ version : "detect" ,
55+ } ,
56+ } ,
57+
58+ rules : {
59+ "prefer-const" : "error" ,
60+ "no-use-before-define" : "off" ,
61+ "@typescript-eslint/no-unused-vars" : "error" ,
62+ "@typescript-eslint/no-explicit-any" : "off" ,
63+ "@typescript-eslint/no-namespace" : "off" ,
64+ "prettier/prettier" : "off" ,
65+ "react/prop-types" : "off" ,
66+ "jest/valid-title" : "off" ,
67+ } ,
68+ } ] ;
0 commit comments