Skip to content

Commit 53d4fda

Browse files
authored
fix: isKitPageComponent on windows (#318)
1 parent 09b35ad commit 53d4fda

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-svelte": patch
3+
---
4+
5+
fix `isKitPageComponent` on windows

src/utils/svelte-kit.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function isKitPageComponent(context: RuleContext): boolean {
2323
"src/routes"
2424
const filePath = context.getFilename()
2525
const projectRootDir = getProjectRootDir(context.getFilename()) ?? ""
26-
const fileName = filePath.split("/").pop() || filePath
26+
const fileName = path.basename(filePath)
2727
return (
2828
filePath.startsWith(path.join(projectRootDir, routes)) &&
2929
// MEMO: check only `+` and file extension for maintainability

0 commit comments

Comments
 (0)