Skip to content

Commit aa470c7

Browse files
authored
chore: apply prettier to all supported file types (#1870)
1 parent d17b001 commit aa470c7

File tree

65 files changed

+865
-795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+865
-795
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ about: Create a report to help us improve
44
title: ''
55
labels: bug
66
assignees: ''
7-
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,9 +24,10 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- SVGO Version [e.g. 2.0.3]
28-
- NodeJs Version [e.g 14.0.4]
29-
- OS: [e.g. iOS]
30-
27+
28+
- SVGO Version [e.g. 2.0.3]
29+
- NodeJs Version [e.g 14.0.4]
30+
- OS: [e.g. iOS]
31+
3132
**Additional context**
3233
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Suggest an idea for this project
44
title: ''
55
labels: enhancement
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/ISSUE_TEMPLATE/plugin_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Suggest a plugin for this project
44
title: ''
55
labels: 'New plugin'
66
assignees: ''
7-
87
---
98

109
**Is your plugin request related to a problem? Please describe.**
@@ -19,4 +18,5 @@ A clear and concise description of what you want to happen.
1918
Include any links pointing to relevant specs or general knowledge that may validate your plugin idea.
2019

2120
**Implementation**
21+
2222
- [ ] Are you volunteering to work on this plugin?

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ nodeLinker: node-modules
22

33
plugins:
44
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
5-
spec: "@yarnpkg/plugin-interactive-tools"
5+
spec: '@yarnpkg/plugin-interactive-tools'
66

77
yarnPath: .yarn/releases/yarn-3.2.3.cjs

CHANGELOG-old.md

Lines changed: 455 additions & 387 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ If you've found a bug with SVGO, [create an issue](https://github.com/svg/svgo/i
66

77
Your issue should ideally contain:
88

9-
* A concise description of the bug.
10-
* How you were using SVGO, the version of the tool, and any configuration or command-line options.
11-
* The SVG that was effected, or a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example).
9+
- A concise description of the bug.
10+
- How you were using SVGO, the version of the tool, and any configuration or command-line options.
11+
- The SVG that was effected, or a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example).
1212

1313
If you haven't found a bug, but need help using SVGO in your project, please consider asking on [Stack Overflow](https://stackoverflow.com/questions/tagged/svgo) with the `[svgo]` tag, you may get help faster there. You can still create an issue if the confusion stemmed from a lack of documentation.
1414

@@ -20,8 +20,8 @@ See: [SECURITY.md](./SECURITY.md)
2020

2121
### Requirements
2222

23-
* [Git](https://git-scm.com/)
24-
* [Node.js 14](https://nodejs.org/) or later
23+
- [Git](https://git-scm.com/)
24+
- [Node.js 14](https://nodejs.org/) or later
2525

2626
### Getting Started
2727

README.md

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Process single files:
3232
```sh
3333
svgo one.svg two.svg -o one.min.svg two.min.svg
3434
```
35+
3536
Process a directory of files recursively with `-f`/`--folder`:
3637

3738
```sh
@@ -51,13 +52,14 @@ SVGO has a plugin architecture. You can read more about all plugins in [Plugins
5152
SVGO reads the configuration from `svgo.config.js` or the `--config path/to/config.js` command-line option. Some other parameters can be configured though command-line options too.
5253

5354
**`svgo.config.js`**
55+
5456
```js
5557
module.exports = {
5658
multipass: false, // boolean
5759
datauri: 'base64', // 'base64'|'enc'|'unenc'
5860
js2svg: {
5961
indent: 4, // number
60-
pretty: false // boolean
62+
pretty: false, // boolean
6163
},
6264
plugins: [
6365
'preset-default', // built-in plugins enabled by default
@@ -67,17 +69,19 @@ module.exports = {
6769
{
6870
name: 'prefixIds',
6971
params: {
70-
prefix: 'uwu'
71-
}
72-
}
73-
]
72+
prefix: 'uwu',
73+
},
74+
},
75+
],
7476
};
7577
```
78+
7679
### Default preset
7780

7881
Instead of configuring SVGO from scratch, you can tweak the default preset to suit your needs by configuring or disabling the respective plugin.
7982

8083
**`svgo.config.js`**
84+
8185
```js
8286
module.exports = {
8387
plugins: [
@@ -91,11 +95,11 @@ module.exports = {
9195
// customize the params of a default plugin
9296
inlineStyles: {
9397
onlyMatchedOnce: false,
94-
}
95-
}
96-
}
97-
}
98-
]
98+
},
99+
},
100+
},
101+
},
102+
],
99103
};
100104
```
101105

@@ -106,6 +110,7 @@ You can find a list of the default plugins in the order they run in [Preset Defa
106110
You can also specify custom plugins:
107111

108112
**`svgo.config.js`**
113+
109114
```js
110115
const importedPlugin = require('./imported-plugin');
111116

@@ -120,9 +125,9 @@ module.exports = {
120125
params: {
121126
paramName: 'paramValue',
122127
},
123-
fn: (ast, params, info) => {}
124-
}
125-
]
128+
fn: (ast, params, info) => {},
129+
},
130+
],
126131
};
127132
```
128133

@@ -139,7 +144,7 @@ const { optimize } = require('svgo');
139144

140145
const result = optimize(svgString, {
141146
path: 'path-to.svg', // recommended
142-
multipass: true // all other config fields are available here
147+
multipass: true, // all other config fields are available here
143148
});
144149

145150
const optimizedSvgString = result.data;
@@ -163,29 +168,29 @@ const config = await loadConfig(configFile, cwd);
163168

164169
## Other ways to use SVGO
165170

166-
| Method | Reference |
167-
| --- | --- |
168-
| Web app | [SVGOMG](https://jakearchibald.github.io/svgomg/) |
169-
| Grunt task | [grunt-svgmin](https://github.com/sindresorhus/grunt-svgmin) |
170-
| Gulp task | [gulp-svgmin](https://github.com/ben-eb/gulp-svgmin) |
171-
| Webpack loader | [image-minimizer-webpack-plugin](https://github.com/webpack-contrib/image-minimizer-webpack-plugin/#optimize-with-svgo) |
172-
| PostCSS plugin | [postcss-svgo](https://github.com/cssnano/cssnano/tree/master/packages/postcss-svgo) |
173-
| Inkscape plugin | [inkscape-svgo](https://github.com/konsumer/inkscape-svgo) |
174-
| Sketch plugin | [svgo-compressor](https://github.com/BohemianCoding/svgo-compressor) |
175-
| Rollup plugin | [rollup-plugin-svgo](https://github.com/porsager/rollup-plugin-svgo) |
176-
| Visual Studio Code plugin | [vscode-svgo](https://github.com/1000ch/vscode-svgo) |
177-
| Atom plugin | [atom-svgo](https://github.com/1000ch/atom-svgo) |
178-
| Sublime plugin | [Sublime-svgo](https://github.com/1000ch/Sublime-svgo) |
179-
| Figma plugin | [Advanced SVG Export](https://www.figma.com/c/plugin/782713260363070260/Advanced-SVG-Export) |
180-
| Linux app | [Oh My SVG](https://github.com/sonnyp/OhMySVG) |
181-
| Browser extension | [SVG Gobbler](https://github.com/rossmoody/svg-gobbler) |
182-
| API | [Vector Express](https://github.com/smidyo/vectorexpress-api#convertor-svgo) |
171+
| Method | Reference |
172+
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
173+
| Web app | [SVGOMG](https://jakearchibald.github.io/svgomg/) |
174+
| Grunt task | [grunt-svgmin](https://github.com/sindresorhus/grunt-svgmin) |
175+
| Gulp task | [gulp-svgmin](https://github.com/ben-eb/gulp-svgmin) |
176+
| Webpack loader | [image-minimizer-webpack-plugin](https://github.com/webpack-contrib/image-minimizer-webpack-plugin/#optimize-with-svgo) |
177+
| PostCSS plugin | [postcss-svgo](https://github.com/cssnano/cssnano/tree/master/packages/postcss-svgo) |
178+
| Inkscape plugin | [inkscape-svgo](https://github.com/konsumer/inkscape-svgo) |
179+
| Sketch plugin | [svgo-compressor](https://github.com/BohemianCoding/svgo-compressor) |
180+
| Rollup plugin | [rollup-plugin-svgo](https://github.com/porsager/rollup-plugin-svgo) |
181+
| Visual Studio Code plugin | [vscode-svgo](https://github.com/1000ch/vscode-svgo) |
182+
| Atom plugin | [atom-svgo](https://github.com/1000ch/atom-svgo) |
183+
| Sublime plugin | [Sublime-svgo](https://github.com/1000ch/Sublime-svgo) |
184+
| Figma plugin | [Advanced SVG Export](https://www.figma.com/c/plugin/782713260363070260/Advanced-SVG-Export) |
185+
| Linux app | [Oh My SVG](https://github.com/sonnyp/OhMySVG) |
186+
| Browser extension | [SVG Gobbler](https://github.com/rossmoody/svg-gobbler) |
187+
| API | [Vector Express](https://github.com/smidyo/vectorexpress-api#convertor-svgo) |
183188

184189
## Donors
185190

186191
| [<img src="https://sheetjs.com/sketch128.png" width="80">](https://sheetjs.com/) | [<img src="https://raw.githubusercontent.com/fontello/fontello/8.0.0/fontello-image.svg" width="80">](https://fontello.com/) |
187-
| :---: | :---: |
188-
| [SheetJS LLC](https://sheetjs.com/) | [Fontello](https://fontello.com/) |
192+
| :------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: |
193+
| [SheetJS LLC](https://sheetjs.com/) | [Fontello](https://fontello.com/) |
189194

190195
## License and Copyright
191196

docs/01-index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Introduction
3-
slug: "introduction"
3+
slug: 'introduction'
44
---
55

66
SVGO (short for SVG Optimizer) is a Node.js library and command-line application for optimizing SVG files.
@@ -11,7 +11,7 @@ SVG files, especially those exported from vector editors, usually contain a lot
1111

1212
### System Requirements
1313

14-
* [Node.js 14](https://nodejs.org/) or later
14+
- [Node.js 14](https://nodejs.org/) or later
1515

1616
<Tabs>
1717
<TabItem value="npm" label="npm" default>

docs/02-preset-default.mdx

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,41 @@ If you aren't using SVGO directly, like through [SVGR](https://github.com/gregbe
1414

1515
The following plugins are included in `preset-default`, in the order that they're executed:
1616

17-
* [Remove Doctype](/docs/plugins/remove-doctype/)
18-
* [Remove XML Declaration](/docs/plugins/remove-xml-proc-inst/)
19-
* [Remove Comments](/docs/plugins/remove-comments/)
20-
* [Remove Metadata](/docs/plugins/remove-metadata/)
21-
* [Remove Editor Namespace Data](/docs/plugins/remove-editors-ns-data/)
22-
* [Cleanup Attributes](/docs/plugins/cleanup-attrs/)
23-
* [Merge Styles](/docs/plugins/merge-styles/)
24-
* [Inline Styles](/docs/plugins/inline-styles/)
25-
* [Minify Styles](/docs/plugins/minify-styles/)
26-
* [Cleanup IDs](/docs/plugins/cleanup-ids/)
27-
* [Remove Useless Defs](/docs/plugins/remove-useless-defs/)
28-
* [Cleanup Numeric Values](/docs/plugins/cleanup-numeric-values/)
29-
* [Convert Colors](/docs/plugins/convert-colors/)
30-
* [Remove Unknowns and Defaults](/docs/plugins/remove-unknowns-and-defaults/)
31-
* [Remove Non-inheritable Group Attributes](/docs/plugins/remove-non-inheritable-group-attrs/)
32-
* [Remove Useless Stroke and Fill](/docs/plugins/remove-useless-stroke-and-fill/)
33-
* [Remove ViewBox](/docs/plugins/remove-viewbox/)
34-
* [Cleanup Enable Background](/docs/plugins/cleanup-enable-background/)
35-
* [Remove Hidden Elements](/docs/plugins/remove-hidden-elems/)
36-
* [Remove Empty Text](/docs/plugins/remove-empty-text/)
37-
* [Convert Shape to Path](/docs/plugins/convert-shape-to-path/)
38-
* [Convert Ellipse to Circle](/docs/plugins/convert-ellipse-to-circle/)
39-
* [Move Element Attributes to Group](/docs/plugins/move-elems-attrs-to-group/)
40-
* [Move Group Attributes to Element](/docs/plugins/move-group-attrs-to-elem/)
41-
* [Collapse Groups](/docs/plugins/collapse-groups/)
42-
* [Convert Path Data](/docs/plugins/convert-path-data/)
43-
* [Convert Transform](/docs/plugins/convert-transform/)
44-
* [Remove Empty Attributes](/docs/plugins/remove-empty-attrs/)
45-
* [Remove Empty Containers](/docs/plugins/remove-empty-containers/)
46-
* [Remove Unused Namespaces](/docs/plugins/remove-unused-namespaces/)
47-
* [Merge Paths](/docs/plugins/merge-paths/)
48-
* [Sort Attributes](/docs/plugins/sort-attrs/)
49-
* [Sort Defs Children](/docs/plugins/sort-defs-children/)
50-
* [Remove Title](/docs/plugins/remove-title/)
51-
* [Remove Description](/docs/plugins/remove-desc/)
17+
- [Remove Doctype](/docs/plugins/remove-doctype/)
18+
- [Remove XML Declaration](/docs/plugins/remove-xml-proc-inst/)
19+
- [Remove Comments](/docs/plugins/remove-comments/)
20+
- [Remove Metadata](/docs/plugins/remove-metadata/)
21+
- [Remove Editor Namespace Data](/docs/plugins/remove-editors-ns-data/)
22+
- [Cleanup Attributes](/docs/plugins/cleanup-attrs/)
23+
- [Merge Styles](/docs/plugins/merge-styles/)
24+
- [Inline Styles](/docs/plugins/inline-styles/)
25+
- [Minify Styles](/docs/plugins/minify-styles/)
26+
- [Cleanup IDs](/docs/plugins/cleanup-ids/)
27+
- [Remove Useless Defs](/docs/plugins/remove-useless-defs/)
28+
- [Cleanup Numeric Values](/docs/plugins/cleanup-numeric-values/)
29+
- [Convert Colors](/docs/plugins/convert-colors/)
30+
- [Remove Unknowns and Defaults](/docs/plugins/remove-unknowns-and-defaults/)
31+
- [Remove Non-inheritable Group Attributes](/docs/plugins/remove-non-inheritable-group-attrs/)
32+
- [Remove Useless Stroke and Fill](/docs/plugins/remove-useless-stroke-and-fill/)
33+
- [Remove ViewBox](/docs/plugins/remove-viewbox/)
34+
- [Cleanup Enable Background](/docs/plugins/cleanup-enable-background/)
35+
- [Remove Hidden Elements](/docs/plugins/remove-hidden-elems/)
36+
- [Remove Empty Text](/docs/plugins/remove-empty-text/)
37+
- [Convert Shape to Path](/docs/plugins/convert-shape-to-path/)
38+
- [Convert Ellipse to Circle](/docs/plugins/convert-ellipse-to-circle/)
39+
- [Move Element Attributes to Group](/docs/plugins/move-elems-attrs-to-group/)
40+
- [Move Group Attributes to Element](/docs/plugins/move-group-attrs-to-elem/)
41+
- [Collapse Groups](/docs/plugins/collapse-groups/)
42+
- [Convert Path Data](/docs/plugins/convert-path-data/)
43+
- [Convert Transform](/docs/plugins/convert-transform/)
44+
- [Remove Empty Attributes](/docs/plugins/remove-empty-attrs/)
45+
- [Remove Empty Containers](/docs/plugins/remove-empty-containers/)
46+
- [Remove Unused Namespaces](/docs/plugins/remove-unused-namespaces/)
47+
- [Merge Paths](/docs/plugins/merge-paths/)
48+
- [Sort Attributes](/docs/plugins/sort-attrs/)
49+
- [Sort Defs Children](/docs/plugins/sort-defs-children/)
50+
- [Remove Title](/docs/plugins/remove-title/)
51+
- [Remove Description](/docs/plugins/remove-desc/)
5252

5353
## Disable a Plugin
5454

@@ -63,11 +63,11 @@ module.exports = {
6363
name: 'preset-default',
6464
params: {
6565
overrides: {
66-
removeViewBox: false
67-
}
68-
}
69-
}
70-
]
66+
removeViewBox: false,
67+
},
68+
},
69+
},
70+
],
7171
};
7272
```
7373

@@ -80,7 +80,7 @@ module.exports = {
8080
'removeXMLProcInst',
8181
'minifyStyles',
8282
'sortAttrs',
83-
'sortDefsChildren'
84-
]
83+
'sortDefsChildren',
84+
],
8585
};
8686
```

docs/03-plugins/add-attributes-to-svg-elements.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Add Attributes to Elements
3-
svgo:
3+
svgo:
44
pluginId: addAttributesToSVGElement
55
parameters:
66
attributes:
@@ -19,16 +19,16 @@ This plugin is only safe to use when a map of key/value pairs is passed. If you
1919

2020
## Usage
2121

22-
<PluginUsage/>
22+
<PluginUsage />
2323

2424
### Parameters
2525

26-
<PluginParams/>
26+
<PluginParams />
2727

2828
## Demo
2929

30-
<PluginDemo/>
30+
<PluginDemo />
3131

3232
## Implementation
3333

34-
* https://github.com/svg/svgo/blob/main/plugins/addAttributesToSVGElement.js
34+
- https://github.com/svg/svgo/blob/main/plugins/addAttributesToSVGElement.js

0 commit comments

Comments
 (0)