Skip to content

Commit 782889b

Browse files
committed
fix: normalize paths
1 parent 802bb4c commit 782889b

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.changeset/silly-mayflies-chew.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+
Normalize paths

plugin/src/utils/worker.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,21 @@ async function isColorAttribute(ctx: PandaContext, _attr: string): Promise<boole
7474
}
7575

7676
const arePathsEqual = (path1: string, path2: string) => {
77-
const stats1 = fs.statSync(path1)
78-
const stats2 = fs.statSync(path2)
77+
const normalizedPath1 = path.resolve(path1)
78+
const normalizedPath2 = path.resolve(path2)
7979

80-
return stats1.dev === stats2.dev && stats1.ino === stats2.ino
80+
return normalizedPath1 === normalizedPath2
8181
}
8282

8383
async function isConfigFile(fileName: string): Promise<boolean> {
8484
return arePathsEqual(configPath!, fileName)
8585
}
8686

8787
async function isValidFile(ctx: PandaContext, fileName: string): Promise<boolean> {
88-
return ctx.getFiles().includes(fileName)
88+
return ctx.getFiles().some((file) => arePathsEqual(file, fileName))
8989
}
9090

9191
async function resolveShorthands(ctx: PandaContext, name: string): Promise<string[] | undefined> {
92-
console.log('name', name, ctx.utility.getPropShorthandsMap().get(name))
9392
return ctx.utility.getPropShorthandsMap().get(name)
9493
}
9594

0 commit comments

Comments
 (0)