1
1
import globals from "globals" ;
2
- import js from "@eslint/js" ;
3
- import ts from "@ typescript-eslint/eslint-plugin " ;
4
- import tsParser from "@typescript- eslint/parser " ;
5
- import react from "eslint-plugin-react" ;
6
- import reactRefresh from "eslint-plugin-react-refresh " ;
7
- import reactHooks from "eslint-plugin-react-hooks " ;
8
- import unicorn from "eslint-plugin-unicorn " ;
2
+ import eslint from "@eslint/js" ;
3
+ import tseslint from "typescript-eslint" ;
4
+ import reactPlugin from "eslint-plugin-react " ;
5
+ import reactRefreshPlugin from "eslint-plugin-react-refresh " ;
6
+ import reactHooksPlugin from "eslint-plugin-react-hooks " ;
7
+ import unicornPlugin from "eslint-plugin-unicorn " ;
8
+ import eslintConfigPrettier from "eslint-config-prettier " ;
9
9
10
- export default [
11
- js . configs . recommended ,
10
+ export default tseslint . config (
11
+ eslint . configs . recommended ,
12
+ ...tseslint . configs . recommended ,
13
+ unicornPlugin . configs [ "flat/recommended" ] ,
12
14
{
13
- ignores : [ "**/dist" , "**/results" , "**/node_modules" , "css" , "**/csv_export.js" ] ,
14
- } ,
15
- {
16
- plugins : { unicorn } ,
17
15
rules : {
18
- ...unicorn . configs . recommended . rules ,
19
16
// no:
20
17
"unicorn/filename-case" : "off" ,
21
18
"unicorn/no-for-loop" : "off" ,
@@ -43,17 +40,11 @@ export default [
43
40
} ,
44
41
languageOptions : { globals : { ...globals . node } } ,
45
42
} ,
46
- {
47
- files : [ "**/*.{ts,tsx}" ] ,
48
- plugins : { "@typescript-eslint" : ts } ,
49
- languageOptions : { parser : tsParser } ,
50
- rules : ts . configs [ "recommended" ] . rules ,
51
- } ,
52
43
/**
53
44
* Webdriver
54
45
*/
55
46
{
56
- files : [ "webdriver-ts/**/*.ts " ] ,
47
+ files : [ "webdriver-ts/**/*.{js,cjs,ts} " ] ,
57
48
languageOptions : {
58
49
parserOptions : { project : [ "./webdriver-ts/tsconfig.eslint.json" ] } ,
59
50
} ,
@@ -68,27 +59,31 @@ export default [
68
59
* Web
69
60
*/
70
61
{
71
- files : [ "webdriver-ts-results/**/*" ] ,
72
- rules : {
73
- "@typescript-eslint/no-loss-of-precision" : "off" ,
74
- } ,
75
- } ,
76
- {
77
- files : [ "webdriver-ts-results/src/**/*.{js,ts,jsx,tsx}" ] ,
62
+ files : [ "webdriver-ts-results/**/*.{js,cjs,ts,jsx,tsx}" ] ,
78
63
plugins : {
79
- react,
80
- "react-refresh" : reactRefresh ,
81
- "react-hooks" : reactHooks ,
64
+ react : reactPlugin ,
65
+ "react-refresh" : reactRefreshPlugin ,
66
+ "react-hooks" : reactHooksPlugin ,
82
67
} ,
83
68
rules : {
84
- ...react . configs . recommended . rules ,
85
- ...react . configs [ "jsx-runtime" ] . rules ,
86
- ...reactHooks . configs . recommended . rules ,
87
-
69
+ ...reactPlugin . configs . flat . recommended . rules ,
70
+ ...reactPlugin . configs . flat [ "jsx-runtime" ] . rules ,
71
+ ...reactHooksPlugin . configs . recommended . rules ,
88
72
"react/jsx-no-useless-fragment" : "warn" ,
89
73
"react-refresh/only-export-components" : "warn" ,
90
74
} ,
91
- settings : { react : { version : "detect" } } ,
92
- languageOptions : { globals : { ...globals . browser } } ,
75
+ settings : {
76
+ react : {
77
+ version : "18.2" ,
78
+ } ,
79
+ } ,
80
+ languageOptions : {
81
+ ...reactPlugin . configs . flat [ "jsx-runtime" ] . languageOptions ,
82
+ globals : { ...globals . browser } ,
83
+ } ,
84
+ } ,
85
+ {
86
+ ignores : [ "**/node_modules/" , "**/dist/" , "**/results/" , "css/" , "**/csv_export.js" ] ,
93
87
} ,
94
- ] ;
88
+ eslintConfigPrettier
89
+ ) ;
0 commit comments