1+ import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
2+ import globals from "globals" ;
3+ import tsParser from "@typescript-eslint/parser" ;
4+ import path from "node:path" ;
5+ import { fileURLToPath } from "node:url" ;
6+ import js from "@eslint/js" ;
7+ import { FlatCompat } from "@eslint/eslintrc" ;
8+
9+ const __filename = fileURLToPath ( import . meta. url ) ;
10+ const __dirname = path . dirname ( __filename ) ;
11+ const compat = new FlatCompat ( {
12+ baseDirectory : __dirname ,
13+ recommendedConfig : js . configs . recommended ,
14+ allConfig : js . configs . all
15+ } ) ;
16+
17+ export default [ ...compat . extends (
18+ "eslint:recommended" ,
19+ "plugin:@typescript-eslint/eslint-recommended" ,
20+ "plugin:@typescript-eslint/recommended" ,
21+ "plugin:react/recommended" ,
22+ "prettier" ,
23+ ) , {
24+ plugins : {
25+ "@typescript-eslint" : typescriptEslint ,
26+ } ,
27+
28+ languageOptions : {
29+ globals : {
30+ ...globals . node ,
31+ } ,
32+
33+ parser : tsParser ,
34+ } ,
35+
36+ settings : {
37+ react : {
38+ version : "detect" ,
39+ } ,
40+ } ,
41+ } , {
42+ files : [ "**/*.test.ts" , "**/*.test.tsx" , "test/**/*.tsx" ] ,
43+
44+ languageOptions : {
45+ globals : {
46+ ...globals . jest ,
47+ fail : true ,
48+ } ,
49+ } ,
50+
51+ rules : {
52+ "@typescript-eslint/no-explicit-any" : 0 ,
53+ "@typescript-eslint/no-var-requires" : 0 ,
54+ "@typescript-eslint/explicit-function-return-type" : 0 ,
55+ } ,
56+ } , {
57+ files : [ "**/*.js" ] ,
58+
59+ rules : {
60+ "@typescript-eslint/no-var-requires" : 0 ,
61+ "no-console" : 0 ,
62+ } ,
63+ } ] ;
0 commit comments