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

23 Commits

Author SHA1 Message Date
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
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
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
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
davidleston
898f0a2ca5 Closes svg/svgo#759. Upper case hex color now converts to shortname. 2017-07-12 17:15:13 -07:00
Sergey Alimov
dc259059fa Extend currentColor match conditions (string, rx, bool) 2016-12-19 14:55:43 +04:00
Jason
8e5706485e Add boundries to none regex 2016-03-22 08:33:24 -05:00
Jason
97ab6c2a6e Add currentColor param to convertColors plugin 2016-03-21 11:58:33 -05:00
GreLI
02c24c9ca8 Fixed crash on uppercase color name. Fixes #511 2016-03-08 16:34:41 +03:00
GreLI
a7f62d8984 Formatting 2015-06-21 19:13:41 +03: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
15e303bbf0 Convert colors now takes fractional percentages and minor improvements.
Fixes #175 and resolves #178.
2015-03-22 18:45:46 +03:00
GreLI
b868538fe3 Fixed breaking references. Resolves #274 2015-02-15 14:48:22 +03:00
Vasiliy Loginevskiy
ccd0541712 Add shortNames colors optimization. 2014-12-05 23:50:37 +03:00
deepsweet
2816424ed7 global refactoring dump 2013-04-09 22:06:27 +03:00
deepsweet
5485010269 'use strict' motherfucker! do you use it?! 2012-11-27 22:51:31 +02:00
deepsweet
291631509f lib/jsAPI: simplification and refactoring 2012-10-15 08:28:25 +03:00
deepsweet
43d716296a JSHint :-| 2012-10-12 22:36:12 +03:00
deepsweet
13af2ed95e go! 2012-09-27 14:06:28 +03:00