1
0
mirror of https://github.com/svg/svgo.git synced 2025-04-19 10:22:15 +03:00

40 Commits

Author SHA1 Message Date
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
deepsweet
78fdeb697e plugins/convertTransform: minor jsdoc correction 2012-10-20 22:09:20 +03:00
deepsweet
b4141bdfef plugins/convertPathData: remove useless segments feature; a lot of refactoring
plugins/convertTransform: a lot of refactoring
2012-10-20 21:22:02 +03:00
deepsweet
8f31f39b2c plugins/convertTransform: newlines 2012-10-20 14:22:47 +03:00
deepsweet
17c7500719 plugins/convertTransform: remove useless transforms; refactoring (close #5) 2012-10-20 14:13:40 +03:00
deepsweet
2f23170076 new plugin convertTransform 2012-10-20 12:49:41 +03:00