1
0
mirror of https://github.com/svg/svgo.git synced 2026-01-27 07:02:06 +03:00
Commit Graph

43 Commits

Author SHA1 Message Date
Seth Falco
747cc722d9 chore: revamp how we export types (#2118) 2025-05-04 17:39:44 +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
Seth Falco
9c8768f64d ci: add spellcheck (#2101) 2025-04-12 16:47:32 +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
a3da8b3a76 refactor: use set in _collections (#1899) 2023-12-24 01:54:17 +00:00
Seth Falco
22533f1ffe chore: update prettier and eslint (#1885) 2023-12-15 13:10:21 +00:00
Jon Dufresne
40544220e8 chore: tidy up eslint config and usage (#1883) 2023-12-15 12:32:20 +00:00
Jon Dufresne
d6ff70baf9 chore: fix several typos (#1868) 2023-12-03 18:02:22 +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
238d3bf600 Refactor convertStyleToAttrs (#1635)
Did not rewrite much, just migrated to tsdoc and visitor plugin api.
This plugin will be obsolete eventually.
2022-01-20 10:55:01 +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
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
d1d6e5efe8 Remove prefix/local support in elements and attributes (#1413)
These parts of element and attribute name are easy to extract.
Now we can easily replace attrs with xast attributes object.
2021-03-10 13:26:15 +03:00
Bogdan Chadkin
00ec0f71fe Format all plugins with prettier 2021-03-09 19:58:00 +03:00
Bogdan Chadkin
a1fcd034fe Disable convertStyleToAttrs plugin by default (#1365)
Ref https://github.com/svg/svgo/issues/1362 https://github.com/svg/svgo/issues/1360

From the [spec](https://www.w3.org/TR/SVG11/styling.html#UsingPresentationAttributes):

> Presentation attributes have lower priority than other CSS style rules specified in author style sheets or ‘style’ attributes.

Though we replace inline styles with attributes without checking if
thare is any `<style>` element. This makes the plugin unsafe and it
should not be enabled by default.
2021-02-23 00:28:09 +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
XhmikosR
136a52cdb6 convertStyleToAttrs: fix wrong character class (#1338) 2021-02-19 02:30:05 +03:00
GreLI
86ecd372e7 Handle !important keyword in convertStyleToAttrs
Fix #749
2018-09-15 15:15:11 +03:00
Vasiliy Loginevskiy
4495a34f55 Remove unnecessary dependency 2017-03-22 09:03:51 +03:00
GreLI
2f88a38730 Use presentation attibures instead of all styling properties.
Fixes #528
2016-04-05 17:29:05 +03:00
David
cdd44ce557 Fixed typo in the JSDoc block of plugins/convertStyleToAttrs.js 2015-12-27 17:31:30 -08: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
15e303bbf0 Convert colors now takes fractional percentages and minor improvements.
Fixes #175 and resolves #178.
2015-03-22 18:45:46 +03:00
GreLI
1e81329982 Non greedy comments regexp 2015-02-23 17:52:53 +03:00
GreLI
84fd2720ca Get rid of strut 2015-02-23 17:36:10 +03:00
GreLI
73f7f3c183 Improved code for parsing CSS in attributes values 2015-02-23 17:29:23 +03:00
GreLI
942d2f74fa Better css parsing in style attr. Fixes #227 2015-02-08 22:33:24 +03:00
deepsweet
578cf60f1d node.extend -> whet.extend 2013-04-10 14:48:07 +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
bb6323c7f8 more JSHint 2012-11-27 16:53:05 +02:00
deepsweet
aa10a8b5de lib/svgo/ 2012-11-09 14:21:06 +02:00
deepsweet
291631509f lib/jsAPI: simplification and refactoring 2012-10-15 08:28:25 +03:00
deepsweet
9ac9c191d4 plugins/convertStyleToAttrs: cleanup style attr 2012-10-02 13:46:54 +04:00
deepsweet
13af2ed95e go! 2012-09-27 14:06:28 +03:00