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

Generate index with kebab casing generates invalid index file #481

Closed
scurker opened this issue Aug 3, 2020 · 2 comments
Closed

Generate index with kebab casing generates invalid index file #481

scurker opened this issue Aug 3, 2020 · 2 comments

Comments

@scurker
Copy link

scurker commented Aug 3, 2020

🐛 Bug Report

Running @svgr/cli against a directory with out-dir and --filename-case kebab generates an invalid index file.

To Reproduce

Steps to reproduce the behavior:

Assuming a directory structure similar to this:

└─ icons
   ├─ foo.svg
   ├─ bar.svg
   └─ foo-bar.svg

svgr icons --out-dir icons --filename-case kebab would generate the following index template:

export { default as foo } from './foo'
export { default as bar } from './bar'
export { default as foo-bar } from './foo-bar'

Expected behavior

foo-bar is not a valid export and will break subsequent imports. I'm not sure what the desired output should be, but perhaps the default export should be Pascal cased for the index file while the filenames remain kebab cased.

Run npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboard

Paste the results here:

## System:
 - OS: macOS Mojave 10.14.6
 - CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
 - Memory: 107.21 MB / 16.00 GB
 - Shell: 3.2.57 - /bin/bash
## Binaries:
 - Node: 10.15.3 - /usr/local/bin/node
 - Yarn: 1.21.1 - /usr/local/bin/yarn
 - npm: 6.4.1 - /usr/local/bin/npm
@open-collective-bot
Copy link

Hey @scurker 👋,
Thank you for opening an issue. We'll get back to you as soon as we can.
Please, consider supporting us on Open Collective. We give a special attention to issues opened by backers.
If you use SVGR at work, you can also ask your company to sponsor us ❤️.

@stale
Copy link

stale bot commented Oct 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

2 participants