vihanb / babel-plugin-wildcard

Wildcard imports import a directories JS files
MIT License
186 stars 27 forks source link

Pascal Case is used for file names #18

Closed serhiipalash closed 6 years ago

serhiipalash commented 6 years ago

You are currently using Pascal Case as default for file names, not Camel Case. Can you change this?

With Camel Case file name like this my-test-file.js should be myTestFile, but get MyTestFile.

You can use humps library for file names conversion https://www.npmjs.com/package/humps

Also you can update api with something like this if you want

{
    "plugins": [
        ["wildcard", {
           "camelizeNames": true
        }]
    ]
}

{
    "plugins": [
        ["wildcard", {
           "pascalizeNames": true
        }]
    ]
}
celicoo commented 6 years ago

I also observed that. Please fix it? :D

vihanb commented 6 years ago

Did not originally think of this. Will add a camelcase/pascalcase option in config for this...

celicoo commented 6 years ago

@vihanb you are awesome <3.

vihanb commented 6 years ago

just added this option: https://github.com/vihanb/babel-plugin-wildcard#usecamelcase let me know if you encounter any issues with it