GithubHelp home page GithubHelp logo

Dashes in filename about create-index HOT 9 CLOSED

gajus avatar gajus commented on May 28, 2024
Dashes in filename

from create-index.

Comments (9)

jakesylvestre avatar jakesylvestre commented on May 28, 2024 2

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.

gajus avatar gajus commented on May 28, 2024

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.

willcode4food avatar willcode4food commented on May 28, 2024

Thanks for the quick response. Is this by design or a limitation of the methods to parse filenames?

from create-index.

gajus avatar gajus commented on May 28, 2024

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.

willcode4food avatar willcode4food commented on May 28, 2024

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.

gajus avatar gajus commented on May 28, 2024

create-index does not perform any sort of name normalisation.

from create-index.

willcode4food avatar willcode4food commented on May 28, 2024

Understood. thanks for the info. I'll move in another direction

from create-index.

gajus avatar gajus commented on May 28, 2024

I strongly encourage to have 1=1 relation between import files and variables representing the asset.

from create-index.

willcode4food avatar willcode4food commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.