Skip to content

Commit a903027

Browse files
committed
fix: false positive
1 parent cfaf58c commit a903027

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

src/rules/no-export-load-in-svelte-module-in-kit-pages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default createRule("no-export-load-in-svelte-module-in-kit-pages", {
3737

3838
// export function load() {}
3939
// export const load = () => {}
40-
[`ExportNamedDeclaration :matches(FunctionDeclaration, VariableDeclaration > VariableDeclarator) > Identifier[name="load"]`]:
40+
[`:matches(ExportNamedDeclaration > FunctionDeclaration, ExportNamedDeclaration > VariableDeclaration > VariableDeclarator) > Identifier.id[name="load"]`]:
4141
(node: ESTree.Identifier) => {
4242
if (!isModule) return {}
4343
return context.report({
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script context="module">
2+
export function fn() {
3+
const load = () => {}
4+
}
5+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<script context="module">
2+
function load() {}
3+
export function foo(load) {}
4+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<script context="module">
2+
function load() {}
3+
export const foo = load
4+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script context="module">
2+
export function fn() {
3+
function load() {}
4+
}
5+
</script>

0 commit comments

Comments
 (0)