-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for
{@snippet}
and {@render}
in mustache-spacin…
…g rule (#624)
- Loading branch information
Showing
20 changed files
with
179 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"eslint-plugin-svelte": minor | ||
--- | ||
|
||
feat: add support for `{@snippet}` and `{@render}` in mustache-spacing rule |
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
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
8 changes: 8 additions & 0 deletions
8
...tures/rules/mustache-spacing/invalid/always-after-expression/snippet-render01-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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
- message: Expected 1 space before '}', but not found. | ||
line: 2 | ||
column: 16 | ||
suggestions: null | ||
- message: Expected 1 space before '}', but not found. | ||
line: 4 | ||
column: 15 | ||
suggestions: null |
4 changes: 4 additions & 0 deletions
4
...ures/rules/mustache-spacing/invalid/always-after-expression/snippet-render01-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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- prettier-ignore --> | ||
{#snippet foo()} | ||
{/snippet} | ||
{@render foo()} |
4 changes: 4 additions & 0 deletions
4
...res/rules/mustache-spacing/invalid/always-after-expression/snippet-render01-output.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- prettier-ignore --> | ||
{#snippet foo() } | ||
{/snippet} | ||
{@render foo() } |
3 changes: 3 additions & 0 deletions
3
...rules/mustache-spacing/invalid/always-after-expression/snippet-render01-requirements.json
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": ">=5.0.0-0" | ||
} |
24 changes: 24 additions & 0 deletions
24
tests/fixtures/rules/mustache-spacing/invalid/always/snippet-render01-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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- message: Expected 1 space after '{', but not found. | ||
line: 2 | ||
column: 1 | ||
suggestions: null | ||
- message: Expected 1 space before '}', but not found. | ||
line: 2 | ||
column: 16 | ||
suggestions: null | ||
- message: Expected 1 space after '{', but not found. | ||
line: 3 | ||
column: 1 | ||
suggestions: null | ||
- message: Expected 1 space before '}', but not found. | ||
line: 3 | ||
column: 10 | ||
suggestions: null | ||
- message: Expected 1 space after '{', but not found. | ||
line: 4 | ||
column: 1 | ||
suggestions: null | ||
- message: Expected 1 space before '}', but not found. | ||
line: 4 | ||
column: 15 | ||
suggestions: null |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/mustache-spacing/invalid/always/snippet-render01-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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- prettier-ignore --> | ||
{#snippet foo()} | ||
{/snippet} | ||
{@render foo()} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/mustache-spacing/invalid/always/snippet-render01-output.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- prettier-ignore --> | ||
{ #snippet foo() } | ||
{ /snippet } | ||
{ @render foo() } |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/rules/mustache-spacing/invalid/always/snippet-render01-requirements.json
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": ">=5.0.0-0" | ||
} |
24 changes: 24 additions & 0 deletions
24
tests/fixtures/rules/mustache-spacing/invalid/snippet-render01-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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- message: Expected no space after '{', but found. | ||
line: 2 | ||
column: 3 | ||
suggestions: null | ||
- message: Expected no space before '}', but found. | ||
line: 2 | ||
column: 17 | ||
suggestions: null | ||
- message: Expected no space after '{', but found. | ||
line: 3 | ||
column: 1 | ||
suggestions: null | ||
- message: Expected no space before '}', but found. | ||
line: 3 | ||
column: 11 | ||
suggestions: null | ||
- message: Expected no space after '{', but found. | ||
line: 4 | ||
column: 1 | ||
suggestions: null | ||
- message: Expected no space before '}', but found. | ||
line: 4 | ||
column: 16 | ||
suggestions: null |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/mustache-spacing/invalid/snippet-render01-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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- prettier-ignore --> | ||
{ #snippet foo() } | ||
{ /snippet } | ||
{ @render foo() } |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/mustache-spacing/invalid/snippet-render01-output.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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- prettier-ignore --> | ||
{#snippet foo()} | ||
{/snippet} | ||
{@render foo()} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/mustache-spacing/invalid/snippet-render01-requirements.json
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"FIXME": "It seems to return the wrong location in Svelte v5.", | ||
"svelte": "<=0.0.0 >=5.0.0-0" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/mustache-spacing/valid/always/snippet-render01-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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- prettier-ignore --> | ||
{ #snippet foo() } | ||
{ /snippet } | ||
{ @render foo() } |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/rules/mustache-spacing/valid/always/snippet-render01-requirements.json
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": ">=5.0.0-0" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/fixtures/rules/mustache-spacing/valid/snippet-render01-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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!-- prettier-ignore --> | ||
{#snippet foo()} | ||
{/snippet} | ||
{@render foo()} |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/rules/mustache-spacing/valid/snippet-render01-requirements.json
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"svelte": ">=5.0.0-0" | ||
} |