Seth Falco
9078e8ca08
refactor(cleanupNumbericValues): improve how viewbox is split ( #2046 )
2024-07-02 10:07:57 +01:00
Seth Falco
5481fc2477
fix: don't insert 0 at start or end of attribute if whitespace ( #2036 )
2024-06-14 12:48:56 +01:00
Jon Dufresne
2442f74239
chore: convert project to us ECMAScript modules (preserving CJS compatibility) ( #1905 )
2024-01-03 16:17:37 +00:00
Seth Falco
22533f1ffe
chore: update prettier and eslint ( #1885 )
2023-12-15 13:10:21 +00:00
Bogdan Chadkin
e2e65cfc1e
Move plugin types into d.ts
2022-11-11 12:19:38 +03:00
Bogdan Chadkin
e6bd703b0a
Remove unused active and type fields from plugins
2022-10-08 23:39:58 +03:00
Bogdan Chadkin
0ead871eed
Cover with types numeric values plugins ( #1541 )
...
- cleanupNumericValues
- cleanupListOfValues
2021-08-24 14:57:09 +03:00
XhmikosR
75ec2943b0
Update minor and patch dependencies ( #1528 )
...
* @rollup/plugin-node-resolve ^11.2.0 → ^11.2.1
* @types/jest ^27.0.0 → ^27.0.1
* colorette ^1.2.2 → ^1.3.0
* commander ^7.1.0 → ^7.2.0
* css-tree ^1.1.2 → ^1.1.3
* eslint ^7.22.0 → ^7.32.0
* playwright ^1.9.2 → ^1.14.0
* prettier ^2.2.1 → ^2.3.2
* rollup ^2.42.1 → ^2.56.2
* typescript ^4.2.3 → ^4.3.5
2021-08-15 13:57:58 +03:00
Bogdan Chadkin
e6b441aca0
Convert cleanupListOfValues and cleanupNumericValues to visitor ( #1521 )
...
SLightly refactored
2021-08-14 16:48:32 +03:00
Bogdan Chadkin
07f8d606e0
Implement preset-default plugin ( #1513 )
...
I saw complaints about `extendDefaultPlugins` api
- it cannot be used when svgo is installed globally
- it requires svgo to be installed when using svgo-loader or svgo-jsx
- it prevents using serializable config formats like json
In this diff I introduced the new plugin which is a bundle of all
default plugins.
```js
module.exports = {
plugins: [
'preset_default',
// or
{
name: 'preset_default',
floatPrecision: 4,
overrides: {
convertPathData: {
applyTransforms: false
}
}
}
]
}
```
2021-08-13 19:07:08 +03:00
Bogdan Chadkin
6f2f62c5ee
Access attributes directly ( #1433 )
...
Got rid from `.attrs`, `.attr()` and `.addAttr()` usages
2021-03-18 18:53:20 +03:00
Bogdan Chadkin
8098ab7fb6
Replace attributes iterators with for/of ( #1431 )
...
These iterators allows to directly manipulate passed value
which does not let us to get rid from legacy "attrs" field.
Object.entries makes it easier to get an access to both attribute
name and value.
2021-03-17 12:50:16 +03:00
Bogdan Chadkin
e82a672bbf
Prepare root and element nodes for xast
...
Ref https://github.com/syntax-tree/xast
- added type: root | element
- renamed elem to name
- replaced "elem" property checks with check for correct type
2021-03-10 18:49:26 +03:00
Bogdan Chadkin
00ec0f71fe
Format all plugins with prettier
2021-03-09 19:58:00 +03:00
Bogdan Chadkin
a7cc20bb43
Setup recommended eslint preset ( #1345 )
...
This is usually enough to prevent silly mistakes.
Formatting will be done by prettier after merging pull requests.
2021-02-19 15:26:07 +03:00
GreLI
f3bcbcc6a6
Fix viewBox value parsing
...
Fix #1024
2018-09-15 18:52:35 +03:00
Taylor Hunt
ba07843565
Don’t round version
attribute ( #1028 )
...
Fixes #1003
2018-09-14 13:18:38 +03:00
caub
8592d2080b
fix viewBox round
2017-06-14 12:16:31 +02:00
caub
5828949c21
round viewBox too
2017-06-10 12:33:59 +02:00
GreLI
db78402c8c
Corrected mm/px ratio. Fixes #420
2015-09-02 15:53:08 +03:00
GreLI
a7f62d8984
Formatting
2015-06-21 19:13:41 +03:00
Yoshiya Hinosawa
8e6b365c40
Add --show-plugins option
2015-06-07 19:35:49 +09:00
GreLI
02dcf78d74
Convert abolute lengths to pixel values
2015-02-23 23:06:09 +03:00
deepsweet
2816424ed7
global refactoring dump
2013-04-09 22:06:27 +03:00
deepsweet
c04888df4d
plugins/cleanupNumericValues: wrong floating-point numbers regexp ( fix #92 )
2013-01-18 15:36:26 +02:00
deepsweet
bab164e4ca
E-notated numbers in paths not recognised ( fix #63 )
2012-12-06 22:20:25 +02:00
deepsweet
140daaeaef
merge plugins/roundNumericValues and plugins/removeDefaultPx into one plugins/cleanupNumericValues
2012-11-29 18:42:41 +02:00