Skip to content

Commit a227981

Browse files
committed
test(no-navigation-without-resolve): added rule tests
1 parent 6dd1135 commit a227981

File tree

55 files changed

+383
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+383
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- message: Found a goto() call with a url that isn't resolved.
2+
line: 4
3+
column: 8
4+
suggestions: null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
import { goto as alias } from '$app/navigation';
3+
4+
alias('/foo');
5+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- message: Found a goto() call with a url that isn't resolved.
2+
line: 4
3+
column: 18
4+
suggestions: null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script>
2+
import * as navigation from '$app/navigation';
3+
4+
navigation.goto('/foo');
5+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- message: Found a goto() call with a url that isn't resolved.
2+
line: 5
3+
column: 7
4+
suggestions: null
5+
- message: Found a goto() call with a url that isn't resolved.
6+
line: 6
7+
column: 7
8+
suggestions: null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script>
2+
import { resolve } from '$app/paths';
3+
import { goto } from '$app/navigation';
4+
5+
goto(resolve('/foo') + '/bar');
6+
goto('/foo' + resolve('/bar'));
7+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- message: Found a goto() call with a url that isn't resolved.
2+
line: 6
3+
column: 7
4+
suggestions: null
5+
- message: Found a goto() call with a url that isn't resolved.
6+
line: 7
7+
column: 7
8+
suggestions: null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script>
2+
import { goto } from '$app/navigation';
3+
4+
const value = "/foo";
5+
6+
goto('/foo');
7+
goto(value);
8+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- message: Found a link with a url that isn't resolved.
2+
line: 5
3+
column: 9
4+
suggestions: null
5+
- message: Found a link with a url that isn't resolved.
6+
line: 6
7+
column: 9
8+
suggestions: null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script>
2+
import { resolve } from '$app/paths';
3+
</script>
4+
5+
<a href={resolve('/foo') + '/bar'}>Click me!</a>
6+
<a href={'/foo' + resolve('/bar')}>Click me!</a>

0 commit comments

Comments
 (0)