-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
298f539
commit c1c2c7b
Showing
2 changed files
with
12 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
tests/fixtures/rules/valid-context-access/invalid/case07-errors.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- message: Do not call hasContext except during component initialization. | ||
line: 5 | ||
column: 9 |
9 changes: 9 additions & 0 deletions
9
tests/fixtures/rules/valid-context-access/invalid/case07-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script> | ||
import { hasContext, onMount } from "svelte" | ||
onMount(() => { | ||
if (hasContext("answer")) { | ||
console.log("The answer exist") | ||
} | ||
}) | ||
</script> |