Seth Falco
747cc722d9
chore: revamp how we export types ( #2118 )
2025-05-04 17:39:44 +01:00
Seth Falco
49954bc0d9
chores: various clean ups regardin ESM and TypeScript ( #2117 )
2025-05-03 09:42:29 +01:00
Seth Falco
a8a53dbd90
chore: apply more eslint rules ( #2116 )
2025-05-02 10:00:37 +01:00
Seth Falco
8c593fab06
chore: bulk update all jsdoc and jsdoctypes ( #2114 )
2025-05-01 22:16:52 +01:00
Seth Falco
4573d0178e
chore: migrate plugin types to plugin ( #2111 )
2025-04-30 02:16:53 +01:00
Nathan Baulch
0eccff2794
chore: fix various typos across the project
2025-03-22 11:49:01 +00:00
johnkenny54
4884d59133
fix: revamp matrixToTransform
2024-02-05 21:47:31 +00: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
2661dacc24
fix(convertTransform): fix scale and rotate on skew + refactors ( #1916 )
2023-12-31 00:59:18 +00:00
Seth Falco
c2cacc7060
chore: move health files to .github ( #1906 )
2023-12-27 12:54:30 +00:00
Seth Falco
22533f1ffe
chore: update prettier and eslint ( #1885 )
2023-12-15 13:10:21 +00:00
Jon Dufresne
d6ff70baf9
chore: fix several typos ( #1868 )
2023-12-03 18:02:22 +00:00
Seth Falco
02c7a78536
fix(convertTransform): do not add redundant space between functions ( #1802 )
...
The space is optional between transform functions in the `transform`
attribute and similar properties. This just omits the space as a
micro-optimization.
This does not add new tests is the scenario is covered adequately in
existing tests.
Also refactors js2transform to avoid concatenating in a loop.
2023-09-27 17:20:10 +01: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
1b02799e18
Cover convertTransform plugin with types ( #1542 )
...
In this diff covered convertTransform pluginn with types
and got rid from global state which made data flow more complex and
error prone.
2021-08-25 20:52:31 +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
316a002299
Remove hasAttr and hasAttrLocal usages ( #1447 )
...
In most cases simple check for null is enough.
2021-03-22 01:24:59 +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
07928fc77e
Replace removeAttr with delete operator ( #1432 )
...
delete operator is more explicit and not much harder to use.
2021-03-17 21:40:06 +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
XhmikosR
1310210d4e
Use https when possible and fix an inactive domain ( #1374 )
2021-02-25 13:48:18 +03:00
Bogdan Chadkin
9263d9ab90
Fix svg spec urls in plugins
2021-02-24 11:18:48 +03:00
XhmikosR
727646e6a7
convertTransform: remove unused assignment ( #1354 )
2021-02-20 22:31:56 +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
Vasiliy Loginevskiy
4495a34f55
Remove unnecessary dependency
2017-03-22 09:03:51 +03:00
GreLI
4e320d9d56
Apply smart rounding only if need to round.
...
Fixes #508 . Resolves #284 .
2016-03-20 20:52:37 +03:00
GreLI
614bc00d77
Fixed consecutive transforms precision handling. Fixes #421
2015-09-02 12:24:06 +03:00
GreLI
a0616b0b82
Don't fail on empty transform. Fixes #394
2015-07-05 13:11:31 +03:00
GreLI
a7f62d8984
Formatting
2015-06-21 19:13:41 +03:00
Yoshiya Hinosawa
73c5a73900
Modify jshint rules
2015-06-13 18:32:19 +09:00
Yoshiya Hinosawa
3f8e6fd15c
Fix lint
2015-06-12 00:25:32 +09:00
Yoshiya Hinosawa
8e6b365c40
Add --show-plugins option
2015-06-07 19:35:49 +09:00
GreLI
e9d00c5c57
Reworked rounding functions in convertTransform. Resolves #371
2015-06-05 17:51:59 +03:00
GreLI
ff5e89d5bf
Reworked transform manipulation
2015-05-24 20:50:47 +03:00
GreLI
d0c3355056
Separate property for transformations precision with the increased value by default. Resolves #334
2015-04-12 22:38:29 +03:00
GreLI
97a260bbf3
Proper computations with optional rotate() parameters
2015-04-06 14:47:12 +03:00
GreLI
f49005c68d
Smarter transforms collapsing. Fixes #208
2015-03-22 22:33:22 +03:00
GreLI
5e7caa49dc
Code styling
2015-02-08 19:31:55 +03:00
deepsweet
446796e531
Impossible to set output presision to 0 (no fractional part) ( fix #110 )
2013-05-03 20:55:21 +03:00
deepsweet
2816424ed7
global refactoring dump
2013-04-09 22:06:27 +03:00
deepsweet
2cc829663d
plugins/convertTransform: translate(10, 0) eq translate(10), but not translate(10, 10) eq translate(10) ( fix #83 )
2012-12-23 14:55:36 +02:00
deepsweet
c29a3f9259
plugins/convertPathData: apply transforms to Path pata ( close #33 )
2012-12-23 14:44:52 +02:00
deepsweet
5610f719f2
plugins/convertTransform: do more accurate floating numbers rounding in matrixToTransform() ( fix #68 )
2012-12-07 18:15:16 +02:00
deepsweet
f804f13471
plugins/convertTransform: error in matrices multiplication ( fix #58 )
2012-11-29 21:55:56 +02:00
deepsweet
5485010269
'use strict' motherfucker! do you use it?!
2012-11-27 22:51:31 +02:00
deepsweet
8570a24128
plugins/convertTransform: mark translate() and scale() as useless only with one param ( fix #57 )
2012-11-26 19:43:18 +02:00
deepsweet
aa10a8b5de
lib/svgo/
2012-11-09 14:21:06 +02:00
deepsweet
f73e05a0e6
plugins/convertTransform: add patternTransform attribute to the process ( close #15 )
2012-10-22 23:25:39 +03:00