1- import { FlatCompat } from '@eslint/eslintrc' ;
2- import { dirname } from 'path' ;
3- import { fileURLToPath } from 'url' ;
4- import js from '@eslint/js' ;
5- import nxEslintPlugin from '@nx/eslint-plugin' ;
1+ import { defineConfig } from 'eslint/config' ;
2+ import nx from '@nx/eslint-plugin' ;
3+ import my from '@eddeee888/eslint-plugin' ;
64
7- const compat = new FlatCompat ( {
8- baseDirectory : dirname ( fileURLToPath ( import . meta. url ) ) ,
9- recommendedConfig : js . configs . recommended ,
10- } ) ;
11-
12- export default [
5+ export default defineConfig (
6+ ...nx . configs [ 'flat/base' ] ,
7+ ...nx . configs [ 'flat/typescript' ] ,
8+ ...nx . configs [ 'flat/javascript' ] ,
9+ ...my . configs . typescript ,
1310 {
14- ignores : [ '**/dist' ] ,
11+ languageOptions : {
12+ parserOptions : {
13+ projectService : true ,
14+ } ,
15+ } ,
16+ } ,
17+ {
18+ ignores : [
19+ '**/dist' ,
20+ 'eslint.config.mjs' ,
21+ 'packages/typescript-resolver-files-e2e/src/**/*.generated.*' ,
22+ 'packages/typescript-resolver-files-e2e/src/**/*.gen.*' ,
23+ ] ,
1524 } ,
16- { plugins : { '@nx' : nxEslintPlugin } } ,
1725 {
1826 files : [ '**/*.ts' , '**/*.tsx' , '**/*.js' , '**/*.jsx' ] ,
1927 rules : {
@@ -32,57 +40,12 @@ export default [
3240 ] ,
3341 } ,
3442 } ,
35- ...compat
36- . config ( {
37- extends : [
38- 'plugin:@nx/typescript' ,
39- // FIXME: change to flat config
40- //'plugin:@eddeee888/typescript'
41- ] ,
42- } )
43- . map ( ( config ) => ( {
44- ...config ,
45- files : [ '**/*.ts' , '**/*.tsx' , '**/*.cts' , '**/*.mts' ] ,
46- rules : {
47- ...config . rules ,
48- } ,
49- } ) ) ,
50- ...compat
51- . config ( {
52- extends : [ 'plugin:@nx/javascript' ] ,
53- } )
54- . map ( ( config ) => ( {
55- ...config ,
56- files : [ '**/*.js' , '**/*.jsx' , '**/*.cjs' , '**/*.mjs' ] ,
57- rules : {
58- ...config . rules ,
59- } ,
60- } ) ) ,
61- ...compat
62- . config ( {
63- env : {
64- jest : true ,
65- } ,
66- } )
67- . map ( ( config ) => ( {
68- ...config ,
69- files : [ '**/*.spec.ts' , '**/*.spec.tsx' , '**/*.spec.js' , '**/*.spec.jsx' ] ,
70- rules : {
71- ...config . rules ,
72- } ,
73- } ) ) ,
7443 {
7544 files : [ '**/*.json' ] ,
7645 // Override or add rules here
7746 rules : { } ,
7847 languageOptions : {
7948 parser : await import ( 'jsonc-eslint-parser' ) ,
8049 } ,
81- } ,
82- {
83- ignores : [
84- 'packages/typescript-resolver-files-e2e/src/**/*.generated.*' ,
85- 'packages/typescript-resolver-files-e2e/src/**/*.gen.*' ,
86- ] ,
87- } ,
88- ] ;
50+ }
51+ ) ;
0 commit comments