Skip to content

Commit e6949ea

Browse files
committed
chore: deprecated the no-goto-without-base rule
1 parent a95d368 commit e6949ea

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,6 @@ These rules relate to SvelteKit and its best Practices.
473473

474474
| Rule ID | Description | |
475475
|:--------|:------------|:---|
476-
| [svelte/no-goto-without-base](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-goto-without-base/) | disallow using goto() without the base path | |
477476
| [svelte/no-navigation-without-base](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-navigation-without-base/) | disallow using goto() without the base path | |
478477

479478
## Experimental
@@ -502,6 +501,7 @@ These rules relate to this plugin works:
502501
| Rule ID | Replaced by |
503502
|:--------|:------------|
504503
| [svelte/@typescript-eslint/no-unnecessary-condition](https://sveltejs.github.io/eslint-plugin-svelte/rules/@typescript-eslint/no-unnecessary-condition/) | This rule is no longer needed when using svelte-eslint-parser>=v0.19.0. |
504+
| [svelte/no-goto-without-base](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-goto-without-base/) | [svelte/no-navigation-without-base](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-navigation-without-base/) |
505505

506506
<!--RULES_TABLE_END-->
507507
<!--RULES_SECTION_END-->

docs/rules.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ These rules relate to SvelteKit and its best Practices.
110110

111111
| Rule ID | Description | |
112112
| :------------------------------------------------------------------------- | :------------------------------------------ | :-- |
113-
| [svelte/no-goto-without-base](./rules/no-goto-without-base.md) | disallow using goto() without the base path | |
114113
| [svelte/no-navigation-without-base](./rules/no-navigation-without-base.md) | disallow using goto() without the base path | |
115114

116115
## Experimental
@@ -136,6 +135,7 @@ These rules relate to this plugin works:
136135
- :warning: We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
137136
- :innocent: We don't fix bugs which are in deprecated rules since we don't have enough resources.
138137

139-
| Rule ID | Replaced by |
140-
| :----------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------- |
141-
| [svelte/@typescript-eslint/no-unnecessary-condition](./rules/@typescript-eslint/no-unnecessary-condition.md) | This rule is no longer needed when using svelte-eslint-parser>=v0.19.0. |
138+
| Rule ID | Replaced by |
139+
| :----------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------- |
140+
| [svelte/@typescript-eslint/no-unnecessary-condition](./rules/@typescript-eslint/no-unnecessary-condition.md) | This rule is no longer needed when using svelte-eslint-parser>=v0.19.0. |
141+
| [svelte/no-goto-without-base](./rules/no-goto-without-base.md) | [svelte/no-navigation-without-base](./rules/no-navigation-without-base.md) |

docs/rules/no-goto-without-base.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ since: 'v2.36.0-next.9'
1010

1111
> disallow using goto() without the base path
1212
13+
- :warning: This rule was **deprecated** and replaced by [svelte/no-navigation-without-base](no-navigation-without-base.md) rule.
14+
1315
## :book: Rule Details
1416

1517
This rule reports navigation using SvelteKit's `goto()` function without prefixing a relative URL with the base path. If a non-prefixed relative URL is used for navigation, the `goto` function navigates away from the base path, which is usually not what you wanted to do (for external URLs, `window.location = url` should be used instead).

packages/eslint-plugin-svelte/src/rule-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export interface RuleOptions {
147147
/**
148148
* disallow using goto() without the base path
149149
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-goto-without-base/
150+
* @deprecated
150151
*/
151152
'svelte/no-goto-without-base'?: Linter.RuleEntry<[]>
152153
/**

packages/eslint-plugin-svelte/src/rules/no-goto-without-base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import type { RuleContext } from '../types';
77

88
export default createRule('no-goto-without-base', {
99
meta: {
10+
deprecated: true,
11+
replacedBy: ['no-navigation-without-base'],
1012
docs: {
1113
description: 'disallow using goto() without the base path',
1214
category: 'SvelteKit',

0 commit comments

Comments
 (0)