From 1b9b2524dcaa34f9c348a5cf20a765c556bd1655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20D=C4=9Bdi=C4=8D?= Date: Fri, 29 Nov 2024 21:52:32 +0100 Subject: [PATCH] test(no-navigation-without-base): added namespace import tests --- .../invalid/goto-namespace-import01-errors.yaml | 4 ++++ .../invalid/goto-namespace-import01-input.svelte | 5 +++++ .../invalid/pushState-namespace-import01-errors.yaml | 4 ++++ .../invalid/pushState-namespace-import01-input.svelte | 5 +++++ .../invalid/replaceState-namespace-import01-errors.yaml | 5 +++++ .../invalid/replaceState-namespace-import01-input.svelte | 5 +++++ .../valid/goto-base-namespace-import01-input.svelte | 8 ++++++++ .../valid/link-base-namespace-import01-input.svelte | 6 ++++++ .../valid/pushState-base-namespace-import01-input.svelte | 8 ++++++++ .../replaceState-base-namespace-import01-input.svelte | 8 ++++++++ 10 files changed, 58 insertions(+) create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-namespace-import01-errors.yaml create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-namespace-import01-input.svelte create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/pushState-namespace-import01-errors.yaml create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/pushState-namespace-import01-input.svelte create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/replaceState-namespace-import01-errors.yaml create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/replaceState-namespace-import01-input.svelte create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/goto-base-namespace-import01-input.svelte create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/link-base-namespace-import01-input.svelte create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/pushState-base-namespace-import01-input.svelte create mode 100644 packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/replaceState-base-namespace-import01-input.svelte diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-namespace-import01-errors.yaml b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-namespace-import01-errors.yaml new file mode 100644 index 000000000..8fe7d69b8 --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-namespace-import01-errors.yaml @@ -0,0 +1,4 @@ +- message: Found a goto() call with a url that isn't prefixed with the base path. + line: 4 + column: 18 + suggestions: null diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-namespace-import01-input.svelte b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-namespace-import01-input.svelte new file mode 100644 index 000000000..9e9868428 --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/goto-namespace-import01-input.svelte @@ -0,0 +1,5 @@ + diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/pushState-namespace-import01-errors.yaml b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/pushState-namespace-import01-errors.yaml new file mode 100644 index 000000000..2de0e9fc5 --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/pushState-namespace-import01-errors.yaml @@ -0,0 +1,4 @@ +- message: Found a pushState() call with a url that isn't prefixed with the base path. + line: 4 + column: 23 + suggestions: null diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/pushState-namespace-import01-input.svelte b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/pushState-namespace-import01-input.svelte new file mode 100644 index 000000000..a3c883949 --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/pushState-namespace-import01-input.svelte @@ -0,0 +1,5 @@ + diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/replaceState-namespace-import01-errors.yaml b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/replaceState-namespace-import01-errors.yaml new file mode 100644 index 000000000..39e0e1c85 --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/replaceState-namespace-import01-errors.yaml @@ -0,0 +1,5 @@ +- message: Found a replaceState() call with a url that isn't prefixed with the + base path. + line: 4 + column: 26 + suggestions: null diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/replaceState-namespace-import01-input.svelte b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/replaceState-namespace-import01-input.svelte new file mode 100644 index 000000000..47db8ff31 --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/invalid/replaceState-namespace-import01-input.svelte @@ -0,0 +1,5 @@ + diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/goto-base-namespace-import01-input.svelte b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/goto-base-namespace-import01-input.svelte new file mode 100644 index 000000000..3a85c9011 --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/goto-base-namespace-import01-input.svelte @@ -0,0 +1,8 @@ + diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/link-base-namespace-import01-input.svelte b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/link-base-namespace-import01-input.svelte new file mode 100644 index 000000000..8e10ccd6e --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/link-base-namespace-import01-input.svelte @@ -0,0 +1,6 @@ + + +Click me!; +Click me!; diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/pushState-base-namespace-import01-input.svelte b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/pushState-base-namespace-import01-input.svelte new file mode 100644 index 000000000..83d16254e --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/pushState-base-namespace-import01-input.svelte @@ -0,0 +1,8 @@ + diff --git a/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/replaceState-base-namespace-import01-input.svelte b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/replaceState-base-namespace-import01-input.svelte new file mode 100644 index 000000000..c87594323 --- /dev/null +++ b/packages/eslint-plugin-svelte/tests/fixtures/rules/no-navigation-without-base/valid/replaceState-base-namespace-import01-input.svelte @@ -0,0 +1,8 @@ +