Comments (9)
I've gone ahead and forked it here: https://github.com/jakesyl/create-index-normalized to camelCase names with a - for anyone interested. @gajus would be cool to have a camelcase option
from create-index.
Dash cannot be part of a valid export name.
On Apr 13, 2016, at 15:35, Marc Arbesman [email protected] wrote:
I seem to be having an issue with dashes in filenames. The index file gets created, but is empty.
thanks
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
from create-index.
Thanks for the quick response. Is this by design or a limitation of the methods to parse filenames?
from create-index.
As far as I know, there is no spec/ proposal that would allow to export a name consisting a dash, e.g.
export 'foo-bar' from './foo-bar';
is not a valid JavaScript code.
If I am wrong and it is valid JavaScript code, then it is a trivial fix.
Regardless, looking at http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Creact%2Cstage-0&experimental=true&loose=false&spec=false&code=export%20'foo-bar'%20from%20'.%2Ffoo-bar'%3B, it does not look like above is valid syntax.
from create-index.
I understand. I am trying to do something more like this
export 'foobar' from './foo-bar'
As far as I am aware, this is valid syntax and can be transpiled. Please let me know what you think
from create-index.
create-index
does not perform any sort of name normalisation.
from create-index.
Understood. thanks for the info. I'll move in another direction
from create-index.
I strongly encourage to have 1=1 relation between import files and variables representing the asset.
from create-index.
Agreed this is ideal. When working on someone else's code, I'm trying to be as unintrusive as possible. This discussion makes me realize, perhaps renaming files might be something I need to discuss with the repo owner.
thanks
from create-index.
Related Issues (20)
- Feature request: Excluding specific files HOT 4
- README uses previous export syntax example HOT 1
- There is no check if the imported file has a default. HOT 2
- Add option to uppercase first char of export HOT 4
- Recursive option when using programmatically HOT 1
- Functions exported as default not picked up
- Include folder name in banner
- Importing created subdirectory index files HOT 5
- JSX Files HOT 2
- Add --output option to configure output file HOT 3
- Files with hyphen are ignored. HOT 1
- option to "disable" semicolon HOT 2
- implementation with .ts file maybe?
- [bug] can't read file or folder with "-"? HOT 5
- Tests don't work? HOT 2
- 'create-index' is not recognized as an internal or external command, operable program or batch file HOT 1
- Support creating index with default export HOT 9
- Use with typescript, add webpack plugin HOT 2
- Wrong casing in generated index.js
- Conflicts between files and folders with same name
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-index.