-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(no-navigation-without-base): added support for urls defined in v…
…ariables
- Loading branch information
1 parent
86898b2
commit 8a9a43d
Showing
13 changed files
with
110 additions
and
25 deletions.
There are no files selected for viewing
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
6 changes: 5 additions & 1 deletion
6
...svelte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-no-base01-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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
- message: Found a goto() call with a url that isn't prefixed with the base path. | ||
line: 4 | ||
line: 6 | ||
column: 7 | ||
suggestions: null | ||
- message: Found a goto() call with a url that isn't prefixed with the base path. | ||
line: 7 | ||
column: 7 | ||
suggestions: null |
3 changes: 3 additions & 0 deletions
3
...velte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-no-base01-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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<script> | ||
import { goto } from '$app/navigation'; | ||
const value = "/foo"; | ||
goto('/foo'); | ||
goto(value); | ||
</script> |
10 changes: 7 additions & 3 deletions
10
...svelte/tests/fixtures/rules/no-navigation-without-base/invalid/link-no-base01-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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
- message: Found a link with a url that isn't prefixed with the base path. | ||
line: 1 | ||
line: 4 | ||
column: 10 | ||
suggestions: null | ||
- message: Found a link with a url that isn't prefixed with the base path. | ||
line: 2 | ||
line: 5 | ||
column: 9 | ||
suggestions: null | ||
- message: Found a link with a url that isn't prefixed with the base path. | ||
line: 3 | ||
line: 6 | ||
column: 9 | ||
suggestions: null | ||
- message: Found a link with a url that isn't prefixed with the base path. | ||
line: 7 | ||
column: 9 | ||
suggestions: null |
4 changes: 4 additions & 0 deletions
4
...velte/tests/fixtures/rules/no-navigation-without-base/invalid/link-no-base01-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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<script> | ||
const value = "/foo"; | ||
</script> | ||
<a href="/foo">Click me!</a> | ||
<a href={'/foo'}>Click me!</a> | ||
<a href={'/' + 'foo'}>Click me!</a> | ||
<a href={value}>Click me!</a> |
6 changes: 5 additions & 1 deletion
6
...e/tests/fixtures/rules/no-navigation-without-base/invalid/pushState-no-base01-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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
- message: Found a pushState() call with a url that isn't prefixed with the base path. | ||
line: 4 | ||
line: 6 | ||
column: 12 | ||
suggestions: null | ||
- message: Found a pushState() call with a url that isn't prefixed with the base path. | ||
line: 7 | ||
column: 12 | ||
suggestions: null |
3 changes: 3 additions & 0 deletions
3
.../tests/fixtures/rules/no-navigation-without-base/invalid/pushState-no-base01-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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<script> | ||
import { pushState } from '$app/navigation'; | ||
const value = "/foo"; | ||
pushState('/foo'); | ||
pushState(value); | ||
</script> |
7 changes: 6 additions & 1 deletion
7
...ests/fixtures/rules/no-navigation-without-base/invalid/replaceState-no-base01-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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
- message: Found a replaceState() call with a url that isn't prefixed with the | ||
base path. | ||
line: 4 | ||
line: 6 | ||
column: 15 | ||
suggestions: null | ||
- message: Found a replaceState() call with a url that isn't prefixed with the | ||
base path. | ||
line: 7 | ||
column: 15 | ||
suggestions: null |
3 changes: 3 additions & 0 deletions
3
...sts/fixtures/rules/no-navigation-without-base/invalid/replaceState-no-base01-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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<script> | ||
import { replaceState } from '$app/navigation'; | ||
const value = "/foo"; | ||
replaceState('/foo'); | ||
replaceState(value); | ||
</script> |
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
5 changes: 5 additions & 0 deletions
5
...e/tests/fixtures/rules/no-navigation-without-base/valid/link-base-prefixed01-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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
<script> | ||
import { base } from '$app/paths'; | ||
const value1 = base + '/foo/'; | ||
const value2 = `${base}/foo/`; | ||
</script> | ||
|
||
<a href={base + '/foo/'}>Click me!</a> | ||
<a href={`${base}/foo/`}>Click me!</a> | ||
<a href={value1}>Click me!</a> | ||
<a href={value2}>Click me!</a> |
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
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