From b495028e8f765139ef747bfa90875060f612db7d Mon Sep 17 00:00:00 2001 From: Yongmin Hong Date: Mon, 1 Jul 2024 14:27:37 +0900 Subject: [PATCH] npm(prettier-config): double-declare prettier xml plugin Summary: Fixes T180. Quick hack, I guess. Following ../eslint-config by using deps not devDeps. patch version bump for not adding/removing pkgs per se. Signed-off-by: Yongmin Hong Test Plan: land, update prettier pkg and do prettier commands. Reviewers: O1 revi & automations, revi Reviewed By: O1 revi & automations, revi Tags: #npm Maniphest Tasks: T180 Differential Revision: https://issuetracker.revi.xyz/D480 --- npm/prettier-config/CHANGELOG.md | 10 ++++++++++ npm/prettier-config/README.md | 13 +++++++++++++ npm/prettier-config/package.json | 12 +++++------- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/npm/prettier-config/CHANGELOG.md b/npm/prettier-config/CHANGELOG.md index ba0c673..98f30db 100644 --- a/npm/prettier-config/CHANGELOG.md +++ b/npm/prettier-config/CHANGELOG.md @@ -1,11 +1,21 @@ # `@revi/prettier-config` changelog +Pre-`v0.1.0` changelog is not available. + +New entry is listed at the top, and old logs may get truncated. + Version bump criteria follows: - major: When the plugin is removed. - minor: When the plugin is added. - patch: When the rule is modified (without plugin addition/removal). +## v0.1.1 + +### Fix + +- Added `@prettier/plugin-xml` to peerDependency to unbreak prettier error. ([T180](https://revi.xyz/t/180)) + ## v0.1.0 ### New plugin diff --git a/npm/prettier-config/README.md b/npm/prettier-config/README.md index 058ce75..f08e7aa 100644 --- a/npm/prettier-config/README.md +++ b/npm/prettier-config/README.md @@ -21,6 +21,8 @@ ## Config 'prettier-plugin-sh', // https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml 'prettier-plugin-toml', + // https://github.com/prettier/plugin-xml + '@prettier/plugin-xml', ], overrides: [ // Sort by parser alphabet. @@ -65,6 +67,17 @@ ## Config ], options: {parser: 'sh', keepPadding: true, minify: false}, }, + { + files: ['*.svg', '*.xml'], + options: { + parser: 'xml', + singleAttributePerLine: false, + xmlQuoteAttributes: 'preserve', + xmlSelfClosingSpace: true, + xmlSortAttributesByKey: false, + xmlWhitespaceSensitivity: 'strict', + }, + }, { files: '.yamllint', options: {parser: 'yaml'}, diff --git a/npm/prettier-config/package.json b/npm/prettier-config/package.json index 0cd6c06..6180ad9 100644 --- a/npm/prettier-config/package.json +++ b/npm/prettier-config/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package.json", "name": "@revi/prettier-config", - "version": "0.1.0", + "version": "0.1.1", "author": { "name": "revi", "email": "package-admin@revi.dev", @@ -11,17 +11,15 @@ "main": "prettier.config.js", "types": "./types/prettier.config.d.ts", "peerDependencies": { + "prettier": "3.3.2" + }, + "dependencies": { "@prettier/plugin-php": "0.22.2", + "@prettier/plugin-xml": "3.4.1", "prettier": "3.3.2", "prettier-plugin-sh": "0.14.0", "prettier-plugin-toml": "2.0.1" }, - "devDependencies": { - "@prettier/plugin-php": "0.22.2", - "prettier-plugin-sh": "0.14.0", - "prettier-plugin-toml": "2.0.1", - "@prettier/plugin-xml": "3.4.1" - }, "scripts": { "tsc": "tsc prettier.config.js --declaration --allowJs --emitDeclarationOnly --esModuleInterop --outdir types" },