Skip to content

Conversation

@chandanrjit
Copy link
Contributor

Hi , it is wonderful module and i have add few changes which may required by others

  • Added to create the Storybook component (Conditional based)
  • Allowed options to change "test" file as "spec.js" .
@snaerth
Copy link
Owner

snaerth commented Nov 12, 2018

@chandanrjit Great addition! I will have a look at it soon

lib/index.js Outdated

if (!notest && !(config && config.includes('notest'))) {
files.push(`${name}.test.${ext}`);
if((config && config.includes('spec')))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use curly braces in my projects :)

* @param {*} string
* @returns
*/
function componentNameWithoutSpecialCharacter(string){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function can be much shorter and you should remove lodash. Please write it like this

/** * Removes special characters from string makes every camel case character uppercase * * @param {String} str - String to transform * @returns {String} */ function componentNameWithoutSpecialCharacter(str){ return str.split('-').map(capitalizeFirstLetter).join('') } 
Copy link
Owner

@snaerth snaerth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chandanrjit Great addition. Please fix some of the comments I made and then I will test the PR. And thank you for this :)

@snaerth
Copy link
Owner

snaerth commented Nov 30, 2018

@chandanrjit
Copy link
Contributor Author

updated PR with recommedations

@snaerth snaerth merged commit 9407d36 into snaerth:master Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants