Skip to content

Commit 5b965b3

Browse files
lopenchiJounQin
andauthored
fix: pass cwd into getRemarkConfig from getRemarkProcessor (#571)
Co-authored-by: JounQin <[email protected]>
1 parent def1f51 commit 5b965b3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-mdx": patch
3+
---
4+
5+
fix: pass `cwd` into `getRemarkConfig` from `getRemarkProcessor`

packages/eslint-mdx/src/worker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export const getRemarkProcessor = async (
141141
filePath: string,
142142
isMdx: boolean,
143143
ignoreRemarkConfig?: boolean,
144+
cwd?: string,
144145
) => {
145146
const initCacheKey = `${String(isMdx)}-${filePath}`
146147

@@ -150,7 +151,9 @@ export const getRemarkProcessor = async (
150151
return cachedProcessor
151152
}
152153

153-
const result = ignoreRemarkConfig ? null : await getRemarkConfig(filePath)
154+
const result = ignoreRemarkConfig
155+
? null
156+
: await getRemarkConfig(filePath, cwd)
154157

155158
const cacheKey = result?.filePath
156159
? `${String(isMdx)}-${result.filePath}`
@@ -241,6 +244,7 @@ runAsWorker(
241244
filePath,
242245
isMdx,
243246
ignoreRemarkConfig,
247+
cwd,
244248
)
245249

246250
const fileOptions: VFileOptions = {

0 commit comments

Comments
 (0)