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

Prepend 'svg' to the component const name if it starts with a number #64

Closed
wants to merge 1 commit into from

Conversation

neo
Copy link

@neo neo commented Mar 20, 2018

Fix #62.

@neo neo changed the title prepend 'svg' to the component const name if it starts with a number Prepend 'svg' to the component const name if it starts with a number Mar 20, 2018
@codecov
Copy link

codecov bot commented Mar 20, 2018

Codecov Report

Merging #64 into master will increase coverage by 0.2%.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #64     +/-   ##
======================================
+ Coverage    48.8%   49%   +0.2%     
======================================
  Files          20    20             
  Lines         250   251      +1     
  Branches       52    53      +1     
======================================
+ Hits          122   123      +1     
  Misses        108   108             
  Partials       20    20
Impacted Files Coverage Δ
src/transforms/wrapIntoComponent.js 87.5% <100%> (+0.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b81d1ad...dd32adc. Read the comment docs.

@gregberge
Copy link
Owner

Thanks for this PR. Unfortunately, this is not the right place for the fix. Can you move it here: https://github.com/smooth-code/svgr/blob/master/src/index.js#L31.

Also by the way, we should modify line 32:

return {  componentName, ...state }

So the user can specify a componentName using rawConvert method.

Can you also add a test targetting rawConvert and verifying that it works?

@neo
Copy link
Author

neo commented Mar 21, 2018

But I thought you said you only want to change the variable name in the code?

We should add Svg in front of numbers but only in component name!

@gregberge
Copy link
Owner

gregberge commented Mar 21, 2018

I meant not in file name. In case of svgr -d lib src

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

Successfully merging this pull request may close these issues.

2 participants