Skip to content

Commit 4005b4c

Browse files
committed
Closes #256
1 parent b70cadf commit 4005b4c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.changeset/beige-drinks-clap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@pandacss/eslint-plugin': patch
3+
---
4+
5+
Fix global configPath

plugin/src/utils/worker.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ type Opts = {
1111
configPath?: string
1212
}
1313

14-
let configPath: string | undefined
1514
const contextCache: { [configPath: string]: Promise<PandaContext> } = {}
1615

1716
async function _getContext(configPath: string | undefined) {
@@ -25,14 +24,13 @@ async function _getContext(configPath: string | undefined) {
2524

2625
export async function getContext(opts: Opts) {
2726
if (process.env.NODE_ENV === 'test') {
28-
configPath = opts.configPath
2927
const ctx = createContext() as unknown as PandaContext
3028
ctx.getFiles = () => ['App.tsx']
3129
return ctx
3230
} else {
33-
configPath = configPath || findConfig({ cwd: opts.configPath ?? opts.currentFile })
31+
const configPath = findConfig({ cwd: opts.configPath ?? opts.currentFile })
3432

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
3634
if (!contextCache[configPath]) {
3735
contextCache[configPath] = _getContext(configPath)
3836
}

0 commit comments

Comments
 (0)