Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom JS config file being checked as YAML #1358

Closed
kylemh opened this issue Feb 21, 2021 · 6 comments
Closed

Custom JS config file being checked as YAML #1358

kylemh opened this issue Feb 21, 2021 · 6 comments

Comments

@kylemh
Copy link

kylemh commented Feb 21, 2021

svgo.config.format.js:

const { extendDefaultPlugins } = require('svgo');

module.exports = {
  plugins: extendDefaultPlugins(),
  floatPrecision: 3,
  multipass: true,
};

When running yarn svgo --pretty --config=svgo.config.format.js src/svgs/**/*.svg I get the following error:

...
src/svgs/uncategorized/Volume-High.svg src/svgs/uncategorized/Volume-Low.svg src/svgs/uncategorized/Volume-Muted.svg
YAMLException: end of the stream or a document separator is expected at line 4, column 10:
      plugins: extendDefaultPlugins(),
             ^
    at generateError (/Users/kyle/Code/@air/air-core/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
...
@TrySound
Copy link
Member

TrySound commented Feb 21, 2021

Hi! Is it possible you still use svgo v1? Because js-yaml is not used in v2.

@kylemh
Copy link
Author

kylemh commented Feb 21, 2021

Yes, I just realized that is the problem and filed boopathi/react-svg-loader#307

@TrySound
Copy link
Member

Resolutions would not help here. APIs are incompatible.

@kylemh
Copy link
Author

kylemh commented Feb 21, 2021

Indeed, I was just trying to offer a point of reference in that repo in case anybody was curious regarding how simple the upgrade would be in that repo. Kind of like: "I tried just in case, but it really is a breaking change, just so you know".

@kylemh kylemh closed this as completed Feb 21, 2021
@kylemh
Copy link
Author

kylemh commented Feb 23, 2021

@TrySound there's been nearly a year of no activity in https://github.com/boopathi/react-svg-loader

I wonder if - with your new org membership - do you think there's room in https://github.com/svg for some kind of bundler/rollup repo.

If not, I'll just fork and move on, but I figured I'd ask.

@TrySound
Copy link
Member

I'm actually planning similar tool on top of svgo. For now I recommend svgr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants