1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-03 05:42:32 +03:00
Commit Graph

4 Commits

Author SHA1 Message Date
700f203169 Fix newline in tests 2021-12-25 15:03:29 +03:00
4b4391fbe3 Refactor basic cli tests (#1595)
Moved some tests to cli.test.js and got rid from mock-stdin dependency.
2021-10-15 12:34:24 +03:00
203db9aaec Replace strip-ansi with --no-color flag (#1588)
nanocolors checks for --color and --no-color flags to force or disable
output coloring. Which can be used instead of strip-ansi package which
btw introduced vulnerability recently.
2021-09-30 14:39:12 +03:00
77102ed096 Add better parser errors (#1553)
Old SVGO errors were not very helpful. Packages like cssnano
(postcss-svgo) had to deal with a lot of issues which are hard to debug
with old errors.

```
Error: Error in parsing SVG: Unquoted attribute value
Line: 1
Column: 29
Char: 6
File: input.svg
```

New errors are more informative and may solve many struggles

```
Error: SvgoParserError: input.svg:2:29: Unquoted attribute value

  1 | <svg viewBox="0 0 120 120">
> 2 |   <circle fill="#ff0000" cx=60.444444" cy="60" r="50"/>
    |                             ^
  3 | </svg>
  4 |
```
2021-09-12 01:09:10 +03:00