File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 96
96
"eslint-plugin-svelte" : " ^2.11.0" ,
97
97
"eslint-plugin-vue" : " ^9.6.0" ,
98
98
"eslint-plugin-yml" : " ^1.2.0" ,
99
+ "glob" : " ^10.3.10" ,
99
100
"mocha" : " ^10.0.0" ,
100
101
"mocha-chai-jest-snapshot" : " ^1.1.3" ,
101
102
"nyc" : " ^15.1.0" ,
Original file line number Diff line number Diff line change 1
1
import type { ParserOptions } from "@typescript-eslint/parser" ;
2
2
import fs from "fs" ;
3
+ import { glob } from "glob" ;
3
4
import path from "path" ;
4
5
6
+ function syncWithGlob ( pattern : string , cwd : string ) : string [ ] {
7
+ return glob
8
+ . sync ( pattern , { cwd } )
9
+ . map ( ( filePath ) => path . resolve ( cwd , filePath ) ) ;
10
+ }
11
+
5
12
export function getProjectConfigFiles ( options : ParserOptions ) : string [ ] {
6
13
const tsconfigRootDir =
7
14
typeof options . tsconfigRootDir === "string"
8
15
? options . tsconfigRootDir
9
16
: process . cwd ( ) ;
17
+
10
18
if ( options . project !== true ) {
11
19
return Array . isArray ( options . project )
12
- ? options . project
13
- : [ options . project ! ] ;
20
+ ? options . project . flatMap ( ( projectPattern : string ) =>
21
+ syncWithGlob ( projectPattern , tsconfigRootDir ) ,
22
+ )
23
+ : syncWithGlob ( options . project ! , tsconfigRootDir ) ;
14
24
}
15
25
16
26
let directory = path . dirname ( options . filePath ! ) ;
You can’t perform that action at this time.
0 commit comments