1
+ import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
2
+ import reactHooks from "eslint-plugin-react-hooks" ;
3
+ import tsdoc from "eslint-plugin-tsdoc" ;
4
+ import { fixupPluginRules } from "@eslint/compat" ;
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 [
20
+ ...compat . extends ( "plugin:react/recommended" , "plugin:@typescript-eslint/recommended" ) ,
21
+ {
22
+ plugins : {
23
+ "@typescript-eslint" : typescriptEslint ,
24
+ "react-hooks" : fixupPluginRules ( reactHooks ) ,
25
+ tsdoc,
26
+ } ,
27
+
28
+ languageOptions : {
29
+ parser : tsParser ,
30
+ ecmaVersion : 2018 ,
31
+ sourceType : "module" ,
32
+
33
+ parserOptions : {
34
+ ecmaFeatures : {
35
+ jsx : true ,
36
+ } ,
37
+ } ,
38
+ } ,
39
+
40
+ settings : {
41
+ react : {
42
+ version : "detect" ,
43
+ } ,
44
+ } ,
45
+
46
+ rules : {
47
+ "@typescript-eslint/explicit-function-return-type" : "off" ,
48
+ "@typescript-eslint/explicit-module-boundary-types" : "off" ,
49
+ "@typescript-eslint/no-unused-expressions" : "off" ,
50
+ "react-hooks/rules-of-hooks" : "error" ,
51
+ "react-hooks/exhaustive-deps" : "error" ,
52
+ "tsdoc/syntax" : "off" ,
53
+ } ,
54
+ } ,
55
+ ] ;
0 commit comments