Skip to content

Commit 42828a6

Browse files
committed
fix: Not reporting mailto: and other unusual schema addresses in no-nmavigation-without-resolve (and its deprecated versions)
1 parent 8bd6198 commit 42828a6

16 files changed

+38
-0
lines changed

.changeset/six-pugs-camp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'eslint-plugin-svelte': patch
3+
---
4+
5+
fix: Not reporting mailto: and other unusual schema addresses in no-nmavigation-without-resolve (and its deprecated versions)

packages/eslint-plugin-svelte/tests/fixtures/rules/no-goto-without-base/invalid/no-base01-errors.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
line: 4
33
column: 7
44
suggestions: null
5+
- message: Found a goto() call with a url that isn't prefixed with the base path.
6+
line: 5
7+
column: 7
8+
suggestions: null

packages/eslint-plugin-svelte/tests/fixtures/rules/no-goto-without-base/invalid/no-base01-input.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
import { goto } from '$app/navigation';
33
44
goto('/foo');
5+
goto('/user:42');
56
</script>

packages/eslint-plugin-svelte/tests/fixtures/rules/no-goto-without-base/valid/absolute-uri01-input.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
44
goto('http://localhost/foo/');
55
goto('https://localhost/foo/');
6+
goto('mailto:[email protected]');
7+
goto('tel:+123456789');
68
</script>

packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/link-no-base01-errors.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
line: 7
1515
column: 9
1616
suggestions: null
17+
- message: Found a link with a url that isn't prefixed with the base path.
18+
line: 8
19+
column: 9
20+
suggestions: null

packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/link-no-base01-input.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
<a href={'/foo'}>Click me!</a>
66
<a href={'/' + 'foo'}>Click me!</a>
77
<a href={value}>Click me!</a>
8+
<a href={'/user:42'}>Click me!</a>

packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/link-with-fragment01-errors.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
line: 7
1515
column: 9
1616
suggestions: null
17+
- message: Found a link with a url that isn't prefixed with the base path.
18+
line: 8
19+
column: 9
20+
suggestions: null

packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/link-with-fragment01-input.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
<a href={'/foo#section'}>Click me!</a>
66
<a href={'/' + 'foo#section'}>Click me!</a>
77
<a href={value}>Click me!</a>
8+
<a href={'/foo#section:42'}>Click me!</a>

packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/link-absolute-url01-input.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
<a href={'http' + '://svelte.dev'}>Click me!</a>
1212
<a href={'https' + '://svelte.dev'}>Click me!</a>
1313
<a href={`${protocol}://svelte.dev`}>Click me!</a>
14+
<a href="mailto:[email protected]">Click me!</a>
15+
<a href="tel:+123456789">Click me!</a>

packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/link-fragment-url01-input.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
<a href={'#' + 'section'}>Click me!</a>
99
<a href={'#' + section}>Click me!</a>
1010
<a href={`#${section}`}>Click me!</a>
11+
<a href={'#user:42'}>Click me!</a>

0 commit comments

Comments
 (0)