Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prettier/plugin-xml

Package Overview
Dependencies
Maintainers
12
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prettier/plugin-xml - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0

9

CHANGELOG.md

@@ -9,2 +9,8 @@ # Changelog

## [2.0.0] - 2022-03-22
### Changed
- Require prettier `2.4.0` for the `bracketSameLine` option.
## [1.2.0] - 2021-12-23

@@ -171,3 +177,4 @@

[unreleased]: https://github.com/prettier/plugin-xml/compare/v1.2.0...HEAD
[unreleased]: https://github.com/prettier/plugin-xml/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/prettier/plugin-xml/compare/v1.2.0...v2.0.0
[1.2.0]: https://github.com/prettier/plugin-xml/compare/v1.1.0...v1.2.0

@@ -174,0 +181,0 @@ [1.1.0]: https://github.com/prettier/plugin-xml/compare/v1.0.2...v1.1.0

70

dist/plugin.js

@@ -5,46 +5,4 @@ "use strict";

};
const prettier_1 = __importDefault(require("prettier"));
const parser_1 = __importDefault(require("./parser"));
const printer_1 = __importDefault(require("./printer"));
// These are the extra options defined by this plugin.
const options = {
xmlSelfClosingSpace: {
type: "boolean",
category: "XML",
default: true,
description: "Adds a space before self-closing tags.",
since: "1.1.0"
},
xmlWhitespaceSensitivity: {
type: "choice",
category: "XML",
default: "strict",
description: "How to handle whitespaces in XML.",
choices: [
{
value: "strict",
description: "Whitespaces are considered sensitive in all elements."
},
{
value: "ignore",
description: "Whitespaces are considered insensitive in all elements."
}
],
since: "0.6.0"
}
};
// We're going to be using the bracketSameLine option, but since it wasn't
// introduced until prettier 2.4.0, we need to add it to our list of options if
// it's not present so that it gets respected.
if (!prettier_1.default
.getSupportInfo()
.options.some((opt) => opt.name === "bracketSameLine")) {
options.bracketSameLine = {
type: "boolean",
category: "Global",
default: false,
description: "Put > of opening tags on the last line instead of on a new line.",
since: "1.0.0"
};
}
const plugin = {

@@ -114,2 +72,3 @@ languages: [

".rss",
".runsettings",
".sch",

@@ -187,3 +146,28 @@ ".scxml",

},
options,
options: {
xmlSelfClosingSpace: {
type: "boolean",
category: "XML",
default: true,
description: "Adds a space before self-closing tags.",
since: "1.1.0"
},
xmlWhitespaceSensitivity: {
type: "choice",
category: "XML",
default: "strict",
description: "How to handle whitespaces in XML.",
choices: [
{
value: "strict",
description: "Whitespaces are considered sensitive in all elements."
},
{
value: "ignore",
description: "Whitespaces are considered insensitive in all elements."
}
],
since: "0.6.0"
}
},
defaultOptions: {

@@ -190,0 +174,0 @@ printWidth: 80,

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

{
"name": "@prettier/plugin-xml",
"version": "1.2.0",
"version": "2.0.0",
"description": "prettier plugin for XML",

@@ -24,10 +24,10 @@ "main": "dist/plugin.js",

"@xml-tools/parser": "^1.0.11",
"prettier": ">=2.3"
"prettier": ">=2.4.0"
},
"devDependencies": {
"@types/jest": "^27.0.0",
"@types/node": "^17.0.4",
"@types/node": "^17.0.22",
"@types/prettier": "^2.3.0",
"@typescript-eslint/eslint-plugin": "^5.8.0",
"@typescript-eslint/parser": "^5.8.0",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"eslint": "^8.5.0",

@@ -34,0 +34,0 @@ "eslint-config-prettier": "^8.0.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc