prettier-plugin-astro
Advanced tools
Comparing version 0.13.0 to 0.14.0
@@ -16,2 +16,8 @@ import { parse } from '@astrojs/compiler/sync'; | ||
}, | ||
astroSkipFrontmatter: { | ||
category: 'Astro', | ||
type: 'boolean', | ||
default: false, | ||
description: 'Skips the formatting of the frontmatter.', | ||
}, | ||
}; | ||
@@ -614,2 +620,5 @@ | ||
if (node.type === 'frontmatter') { | ||
if (options.astroSkipFrontmatter) { | ||
return [group(['---', node.value, '---', hardline]), hardline]; | ||
} | ||
const frontmatterContent = await wrapParserTryCatch(textToDoc, node.value, { | ||
@@ -616,0 +625,0 @@ ...options, |
{ | ||
"name": "prettier-plugin-astro", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "A Prettier Plugin for formatting Astro files", |
@@ -82,2 +82,10 @@ # [Prettier](https://prettier.io/) Plugin for [Astro](https://astro.build/) | ||
### Astro Skip Frontmatter | ||
If you are using another tool to format your JavaScript code, like Biome for example, it is possible to skip formatting the frontmatter. | ||
| Default | CLI Override | API Override | | ||
| ------- | -------------------------------- | ----------------------------- | | ||
| `false` | `--astro-skip-frontmatter <bool>` | `astroSkipFrontmatter: <bool>` | | ||
### Example `.prettierrc.cjs` | ||
@@ -88,2 +96,3 @@ | ||
astroAllowShorthand: false; | ||
astroSkipFrontmatter: false; | ||
} | ||
@@ -90,0 +99,0 @@ ``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106802
829
116