-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] Add option to skip formatting the Frontmatter (#417)
* feat: astroSkipFrontmatter * chore: add tests * style: missing commas and semis * Create thirty-rockets-confess.md --------- Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
- Loading branch information
1 parent
5f7c26e
commit bb756df
Showing
7 changed files
with
41 additions
and
0 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 @@ | ||
--- | ||
"prettier-plugin-astro": minor | ||
--- | ||
|
||
Adds a new option called `astroSkipFrontmatter` to disable formatting the frontmatter. This can be useful when using other tools to format the frontmatter, such as Biome or dprint. |
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
6 changes: 6 additions & 0 deletions
6
test/fixtures/options/option-astro-allow-skip-frontmatter-true/input.astro
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,6 @@ | ||
--- | ||
import Comp from "./comp.astro" | ||
--- | ||
<Comp options={options} /> | ||
<Comp options={ options } /> | ||
<Comp options={ options } /> |
3 changes: 3 additions & 0 deletions
3
test/fixtures/options/option-astro-allow-skip-frontmatter-true/options.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 @@ | ||
{ | ||
"astroAllowSkipFrontmatter": true | ||
} |
7 changes: 7 additions & 0 deletions
7
test/fixtures/options/option-astro-allow-skip-frontmatter-true/output.astro
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,7 @@ | ||
--- | ||
import Comp from "./comp.astro" | ||
--- | ||
|
||
<Comp options={options} /> | ||
<Comp options={options} /> | ||
<Comp options={options} /> |