File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @pandacss/eslint-plugin ' : patch
3
+ ---
4
+
5
+ Fix global configPath
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ type Opts = {
11
11
configPath ?: string
12
12
}
13
13
14
- let configPath : string | undefined
15
14
const contextCache : { [ configPath : string ] : Promise < PandaContext > } = { }
16
15
17
16
async function _getContext ( configPath : string | undefined ) {
@@ -25,14 +24,13 @@ async function _getContext(configPath: string | undefined) {
25
24
26
25
export async function getContext ( opts : Opts ) {
27
26
if ( process . env . NODE_ENV === 'test' ) {
28
- configPath = opts . configPath
29
27
const ctx = createContext ( ) as unknown as PandaContext
30
28
ctx . getFiles = ( ) => [ 'App.tsx' ]
31
29
return ctx
32
30
} else {
33
- configPath = configPath || findConfig ( { cwd : opts . configPath ?? opts . currentFile } )
31
+ const configPath = findConfig ( { cwd : opts . configPath ?? opts . currentFile } )
34
32
35
- // Ensure that the context is refreshed when the configPath changes.
33
+ // The context cache ensures we don't reload the same config multiple times
36
34
if ( ! contextCache [ configPath ] ) {
37
35
contextCache [ configPath ] = _getContext ( configPath )
38
36
}
You can’t perform that action at this time.
0 commit comments