Skip to content

Commit

Permalink
fix: isKitPageComponent on windows (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
DetachHead committed Dec 12, 2022
1 parent 09b35ad commit 53d4fda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fix-isKitPageComponent-on-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-svelte": patch
---

fix `isKitPageComponent` on windows
2 changes: 1 addition & 1 deletion src/utils/svelte-kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function isKitPageComponent(context: RuleContext): boolean {
"src/routes"
const filePath = context.getFilename()
const projectRootDir = getProjectRootDir(context.getFilename()) ?? ""
const fileName = filePath.split("/").pop() || filePath
const fileName = path.basename(filePath)
return (
filePath.startsWith(path.join(projectRootDir, routes)) &&
// MEMO: check only `+` and file extension for maintainability
Expand Down

0 comments on commit 53d4fda

Please sign in to comment.