diff --git a/linters/plugin.yaml b/linters/plugin.yaml
index bb1575a48..179076884 100644
--- a/linters/plugin.yaml
+++ b/linters/plugin.yaml
@@ -538,6 +538,12 @@ lint:
extensions:
- xib
+ - name: xml
+ extensions:
+ - xml
+ comments:
+ - slashes-xml
+
- name: yaml
extensions:
- yaml
diff --git a/linters/prettier/plugin.yaml b/linters/prettier/plugin.yaml
index 07ac90e38..b68809406 100644
--- a/linters/prettier/plugin.yaml
+++ b/linters/prettier/plugin.yaml
@@ -9,17 +9,8 @@ tools:
lint:
definitions:
- name: prettier
- files:
- - typescript
- - yaml
- - css
- - sass
- - html
- - markdown
- - json
- - javascript
- - graphql
- - prettier_supported_configs
+ extra_packages:
+ - "@prettier/plugin-xml"
commands:
- name: format
output: rewrite
@@ -28,6 +19,27 @@ lint:
batch: true
in_place: true
formatter: true
+ files:
+ - typescript
+ - yaml
+ - css
+ - sass
+ - html
+ - markdown
+ - json
+ - javascript
+ - graphql
+ - prettier_supported_configs
+ - name: format-xml
+ output: rewrite
+ run: prettier --plugin=@prettier/plugin-xml -w ${target}
+ success_codes: [0]
+ batch: true
+ in_place: true
+ formatter: true
+ version: ">=3.0.0"
+ files:
+ - xml
tools: [prettier]
suggest_if: files_present
direct_configs:
diff --git a/linters/prettier/test_data/prettier_v2.6.2_xml_test.fmt.shot b/linters/prettier/test_data/prettier_v2.6.2_xml_test.fmt.shot
new file mode 100644
index 000000000..610d1f59d
--- /dev/null
+++ b/linters/prettier/test_data/prettier_v2.6.2_xml_test.fmt.shot
@@ -0,0 +1,25 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Testing formatter prettier test xml_test 1`] = `
+"
+
+
+
+
+
+
+
+
+
+
+ choiceAttribute
+ customLocation
+ attributeSetting
+ INSTALL_DIR
+ choiceIdentifier
+ default
+
+
+
+"
+`;
diff --git a/linters/prettier/test_data/prettier_v3.0.0_xml_test.fmt.shot b/linters/prettier/test_data/prettier_v3.0.0_xml_test.fmt.shot
new file mode 100644
index 000000000..2c7bfc0f7
--- /dev/null
+++ b/linters/prettier/test_data/prettier_v3.0.0_xml_test.fmt.shot
@@ -0,0 +1,20 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Testing formatter prettier test xml_test 1`] = `
+"
+
+
+
+
+ choiceAttribute
+ customLocation
+ attributeSetting
+ INSTALL_DIR
+ choiceIdentifier
+ default
+
+
+
+"
+`;
diff --git a/linters/prettier/test_data/xml_test.in.xml b/linters/prettier/test_data/xml_test.in.xml
new file mode 100644
index 000000000..ddb4b953b
--- /dev/null
+++ b/linters/prettier/test_data/xml_test.in.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+ choiceAttribute
+ customLocation
+ attributeSetting
+ INSTALL_DIR
+ choiceIdentifier
+ default
+
+
+