Skip to content

Commit ea788db

Browse files
committed
test(no-navigation-without-base): added namespace import tests
1 parent 6aa1bb7 commit ea788db

10 files changed

+58
-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 prefixed with the base path.
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,4 @@
1+
- message: Found a pushState() call with a url that isn't prefixed with the base path.
2+
line: 4
3+
column: 23
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.pushState('/foo');
5+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- message: Found a replaceState() call with a url that isn't prefixed with the
2+
base path.
3+
line: 4
4+
column: 26
5+
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.replaceState('/foo');
5+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script>
2+
import * as paths from '$app/paths';
3+
import { goto } from '$app/navigation';
4+
5+
// eslint-disable-next-line prefer-template -- Testing both variants
6+
goto(paths.base + '/foo/');
7+
goto(`${paths.base}/foo/`);
8+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<script>
2+
import * as paths from '$app/paths';
3+
</script>
4+
5+
<a href={paths.base + '/foo/'}>Click me!</a>;
6+
<a href={`${paths.base}/foo/`}>Click me!</a>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script>
2+
import * as paths from '$app/paths';
3+
import { pushState } from '$app/navigation';
4+
5+
// eslint-disable-next-line prefer-template -- Testing both variants
6+
pushState(paths.base + '/foo/');
7+
pushState(`${paths.base}/foo/`);
8+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script>
2+
import * as paths from '$app/paths';
3+
import { replaceState } from '$app/navigation';
4+
5+
// eslint-disable-next-line prefer-template -- Testing both variants
6+
replaceState(paths.base + '/foo/');
7+
replaceState(`${paths.base}/foo/`);
8+
</script>

0 commit comments

Comments
 (0)