lint-staged is very useful with svgo (it will send to svgo` any new or changed SVG).
But lint-staged pass all file names in single command TOOL FILE1 FILE2 FILE3.
svgo falls in this case. Also when you change only two files lint-staged called it with svgo one.svg two.svg which even broke uncommit files :(.
@GreLI do we have any solution for this? If not. just give me CLI API — I will send PR.
Actually, I'm working on it right now.
JFYI, for now current CLI API is
svgo <input-file> <output-file>
(and I want to change that.)
Hi, @GreLI!
Any progress on this issue? lint-staged and svgo are a great couple, but it's annoying to commit not more than one SVG file per commit.
Thanks!
I took a stab at this in #786, people are reaching for the same things for pre-commit
Finally, It has been done it in e3ddf1d96ab88beb9f496a122dee6ebcb4a0c907. Now
svgo *.svg
will work as expected. Haven't updated docs yet to avoid confusion until it'll get released.
Most helpful comment
Actually, I'm working on it right now.