Skip to content

Commit 394acc5

Browse files
committed
chore: deprecated the no-goto-without-base rule
1 parent 7d92cd5 commit 394acc5

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ These rules relate to SvelteKit and its best Practices.
409409

410410
| Rule ID | Description | |
411411
|:--------|:------------|:---|
412-
| [svelte/no-goto-without-base](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-goto-without-base/) | disallow using goto() without the base path | |
413412
| [svelte/no-navigation-without-base](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-navigation-without-base/) | disallow using goto() without the base path | |
414413

415414
## Experimental
@@ -438,6 +437,7 @@ These rules relate to this plugin works:
438437
| Rule ID | Replaced by |
439438
|:--------|:------------|
440439
| [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. |
440+
| [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/) |
441441

442442
<!--RULES_TABLE_END-->
443443
<!--RULES_SECTION_END-->

docs/rules.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ These rules relate to SvelteKit and its best Practices.
111111

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

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

140-
| Rule ID | Replaced by |
141-
| :----------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------- |
142-
| [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. |
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. |
142+
| [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

+2
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

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export interface RuleOptions {
152152
/**
153153
* disallow using goto() without the base path
154154
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-goto-without-base/
155+
* @deprecated
155156
*/
156157
'svelte/no-goto-without-base'?: Linter.RuleEntry<[]>
157158
/**

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

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import type { RuleContext } from '../types.js';
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)