@prettier/plugin-xml
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -9,2 +9,8 @@ # Changelog | ||
## [2.1.0] - 2022-04-16 | ||
### Added | ||
- Support for the `singleAttributePerLine` option. | ||
## [2.0.1] - 2022-03-22 | ||
@@ -183,3 +189,4 @@ | ||
[unreleased]: https://github.com/prettier/plugin-xml/compare/v2.0.1...HEAD | ||
[unreleased]: https://github.com/prettier/plugin-xml/compare/v2.1.0...HEAD | ||
[2.1.0]: https://github.com/prettier/plugin-xml/compare/v2.0.1...v2.1.0 | ||
[2.0.1]: https://github.com/prettier/plugin-xml/compare/v2.0.0...v2.0.1 | ||
@@ -186,0 +193,0 @@ [2.0.0]: https://github.com/prettier/plugin-xml/compare/v1.2.0...v2.0.0 |
@@ -189,3 +189,7 @@ "use strict"; | ||
if (attribute) { | ||
parts.push(indent([line, join(line, path.map(print, "children", "attribute"))])); | ||
const separator = opts.singleAttributePerLine ? hardline : line; | ||
parts.push(indent([ | ||
line, | ||
join(separator, path.map(print, "children", "attribute")) | ||
])); | ||
} | ||
@@ -192,0 +196,0 @@ // Determine the value that will go between the <, name, and attributes |
{ | ||
"name": "@prettier/plugin-xml", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "prettier plugin for XML", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.js", |
@@ -49,9 +49,10 @@ <h1 align="center">Prettier for XML</h1> | ||
| API Option | CLI Option | Default | Description | | ||
| -------------------------- | ------------------------------ | :--------: | ----------------------------------------------------------------------------------------------------- | | ||
| `bracketSameLine` | `--bracket-same-line` | `true` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#bracket-same-line)) | | ||
| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | | ||
| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | | ||
| `xmlSelfClosingSpace` | `--xml-self-closing-space` | `true` | Adds a space before self-closing tags. | | ||
| `xmlWhitespaceSensitivity` | `--xml-whitespace-sensitivity` | `"strict"` | Options are `"strict"` and `"ignore"`. You may want `"ignore"`, [see below](#whitespace). | | ||
| API Option | CLI Option | Default | Description | | ||
| -------------------------- | ------------------------------ | :--------: | ------------------------------------------------------------------------------------------------------------- | | ||
| `bracketSameLine` | `--bracket-same-line` | `true` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#bracket-same-line)) | | ||
| `printWidth` | `--print-width` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)). | | ||
| `singleAttributePerLine` | `--single-attribute-per-line` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#single-attribute-per-line)) | | ||
| `tabWidth` | `--tab-width` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)). | | ||
| `xmlSelfClosingSpace` | `--xml-self-closing-space` | `true` | Adds a space before self-closing tags. | | ||
| `xmlWhitespaceSensitivity` | `--xml-whitespace-sensitivity` | `"strict"` | Options are `"strict"` and `"ignore"`. You may want `"ignore"`, [see below](#whitespace). | | ||
@@ -58,0 +59,0 @@ Any of these can be added to your existing [prettier configuration |
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
39587
12
657
98