1- import { fixupConfigRules , fixupPluginRules } from "@eslint/compat" ;
2- import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
3- import reactHooks from "eslint-plugin-react-hooks" ;
4- import simpleImportSort from "eslint-plugin-simple-import-sort" ;
5- import prettier from "eslint-plugin-prettier" ;
6- import tsParser from "@typescript-eslint/parser" ;
7- import path from "node:path" ;
8- import { fileURLToPath } from "node:url" ;
9- import js from "@eslint/js" ;
10- import { FlatCompat } from "@eslint/eslintrc" ;
1+ import { fixupPluginRules } from '@eslint/compat' ;
2+ import js from '@eslint/js' ;
3+ import playwright from 'eslint-plugin-playwright' ;
4+ import prettier from 'eslint-plugin-prettier/recommended' ;
5+ import react from 'eslint-plugin-react' ;
6+ import reactHooks from 'eslint-plugin-react-hooks' ;
7+ import simpleImportSort from 'eslint-plugin-simple-import-sort' ;
8+ import tseslint from 'typescript-eslint' ;
119
12- const __filename = fileURLToPath ( import . meta. url ) ;
13- const __dirname = path . dirname ( __filename ) ;
14- const compat = new FlatCompat ( {
15- baseDirectory : __dirname ,
16- recommendedConfig : js . configs . recommended ,
17- allConfig : js . configs . all
18- } ) ;
19-
20- export default [ {
21- ignores : [ "node_modules" , "dist" , "rollup" ] ,
22- } , ...fixupConfigRules ( compat . extends (
23- "plugin:playwright/recommended" ,
24- "plugin:react/recommended" ,
25- "plugin:@typescript-eslint/recommended" ,
26- "plugin:react-hooks/recommended" ,
27- "prettier" ,
28- ) ) , {
10+ export default tseslint . config (
11+ js . configs . recommended ,
12+ ...tseslint . configs . recommended ,
13+ {
14+ name : 'ignore' ,
15+ ignores : [
16+ 'node_modules' ,
17+ '**/dist' ,
18+ '**/rollup' ,
19+ '**/node_modules' ,
20+ '**/babel.config.js' ,
21+ ] ,
22+ } ,
23+ {
24+ name : 'main' ,
2925 plugins : {
30- "@typescript-eslint" : fixupPluginRules ( typescriptEslint ) ,
31- "react-hooks" : fixupPluginRules ( reactHooks ) ,
32- "simple-import-sort" : simpleImportSort ,
33- prettier,
26+ react,
27+ 'react-hooks' : fixupPluginRules ( reactHooks ) ,
3428 } ,
3529
3630 languageOptions : {
37- parser : tsParser ,
38- ecmaVersion : 2020 ,
39- sourceType : "module" ,
31+ ecmaVersion : 2020 ,
32+ sourceType : 'module' ,
4033
41- parserOptions : {
42- ecmaFeatures : {
43- jsx : true ,
44- } ,
34+ parserOptions : {
35+ ecmaFeatures : {
36+ jsx : true ,
4537 } ,
38+ } ,
4639 } ,
4740
4841 settings : {
49- react : {
50- pragma : " React" ,
51- version : " detect" ,
52- } ,
42+ react : {
43+ pragma : ' React' ,
44+ version : ' detect' ,
45+ } ,
5346 } ,
5447
5548 rules : {
56- "prettier/prettier" : "error" ,
57- "simple-import-sort/imports" : "error" ,
58- "simple-import-sort/exports" : "error" ,
59- "no-var" : 0 ,
49+ 'no-var' : 0 ,
6050 } ,
61- } , {
62- files : [ "**/*.test.ts" , "**/*.test.tsx" ] ,
63-
51+ } ,
52+ {
53+ name : 'simple-import-sort' ,
54+ plugins : {
55+ 'simple-import-sort' : simpleImportSort ,
56+ } ,
57+ rules : {
58+ 'simple-import-sort/exports' : 'error' ,
59+ 'simple-import-sort/imports' : 'error' ,
60+ } ,
61+ } ,
62+ {
63+ name : 'typescript' ,
64+ files : [ '**/*.test.ts' , '**/*.test.tsx' ] ,
6465 rules : {
65- " @typescript-eslint/ban-ts-comment" : " off" ,
66+ ' @typescript-eslint/ban-ts-comment' : ' off' ,
6667 } ,
67- } ] ;
68+ } ,
69+ {
70+ name : 'playwright' ,
71+ ...playwright . configs [ 'flat/recommended' ] ,
72+ files : [ './packages/examples-e2e/test/*.spec.ts' ] ,
73+ } ,
74+ prettier ,
75+ ) ;
0 commit comments