Giter Site home page Giter Site logo

Comments (21)

mlegenhausen avatar mlegenhausen commented on September 24, 2024

+1

from espree.

nzakas avatar nzakas commented on September 24, 2024

ES6 progress is being tracked here: #10

from espree.

nzakas avatar nzakas commented on September 24, 2024

Oops, hit enter too soon. We will be adding each ES6 feature from Esprima piece by piece. Module will likely be last unless someone submits a PR.

from espree.

cvrebert avatar cvrebert commented on September 24, 2024

Well, there's not even a bullet point for it in #10's checklist currently.

from espree.

nzakas avatar nzakas commented on September 24, 2024

Thanks, I just added it.

from espree.

caridy avatar caridy commented on September 24, 2024

@nzakas I can probably take care of the modules grammar as I did for esprima a while ago.

from espree.

Flickdm avatar Flickdm commented on September 24, 2024

image

from espree.

rjhilgefort avatar rjhilgefort commented on September 24, 2024

👍

from espree.

rosshadden avatar rosshadden commented on September 24, 2024

👍

from espree.

cvrebert avatar cvrebert commented on September 24, 2024

😍

from espree.

nzakas avatar nzakas commented on September 24, 2024

@caridy awesome, we'd appreciate the contribution.

from espree.

caridy avatar caridy commented on September 24, 2024

ok, I got a chance to put some time on this last night, and a questions arise:

In esprima, we introduced {sourceType: "module"}, which defines extra.isModule flag to signal to esprima that is should enforce strict mode, and should enable export/import declarations.

In espree, it seems that extra.ecmaFeatures.<something> will be the way to switch modules on. The problem is that enabling modules implies enabling other features as per the modules' grammar, e.g.: import let foo = 1;, which requires blockBindings to be available. Is there a provision to define dependencies between features? My proposal will be to add a provision similar to {sourceType: "module"}, which will flip multiple features under extra.ecmaFeatures, in this case, modules and blockBindings, and eventually classes.

from espree.

nzakas avatar nzakas commented on September 24, 2024

I think having sourceType: "module" is the right choice, both for Esprima compatibility and also because I don't like the idea of ecmaFeatures having dependencies on one another.

So +1 to your proposal.

from espree.

MoOx avatar MoOx commented on September 24, 2024

Interested too by import/export support in espree :)

from espree.

naholyr avatar naholyr commented on September 24, 2024

👍

from espree.

jozanza avatar jozanza commented on September 24, 2024

👍 This is awesome. When can we expect it to get published to npm?

from espree.

nzakas avatar nzakas commented on September 24, 2024

When the work has been done. :)

I appreciate everyone's enthusiasm, but there's no need for additional +1ing. We're doing our best to get this done and this issue will be closed when the work is complete.

from espree.

naholyr avatar naholyr commented on September 24, 2024

You're awesome <3

from espree.

ai avatar ai commented on September 24, 2024

Does eslint-babel can help in this issue?

from espree.

douglasduteil avatar douglasduteil commented on September 24, 2024

+1

from espree.

kentcdodds avatar kentcdodds commented on September 24, 2024

@ai, eslint-babel doesn't support it properly either. Given:

import foo as 'foo';

foo.bar();

currently results in:

3:1  error  'foo' is not defined                              no-undef

from espree.

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.