Giter Site home page Giter Site logo

Update module functionality about espree HOT 9 CLOSED

eslint avatar eslint commented on September 24, 2024
Update module functionality

from espree.

Comments (9)

nzakas avatar nzakas commented on September 24, 2024

Looking at usage patterns, I think I'd also like to make a small change:

  1. Add a modules feature flag that just enables import/export declarations and switches the parser into strict mode.
  2. Make sourceType = "module" turn on every ES6 feature flag, including modules.

I think that gives us both parity with Esprima and the configurability some have asked for in ESLint.

from espree.

caridy avatar caridy commented on September 24, 2024

ha, I told you so!, lets roll with that, should be flexible enough. I wonder if the inverse will be possible. Using sourceType="module" with class disabled. This is sort of a requirement that we have at Yahoo, where we want to focus on zero-cost abstraction features only rather than all. e.g.: we want to use modules but we don't want to use let.

from espree.

nzakas avatar nzakas commented on September 24, 2024

Yup, you were right.

I think in this model, you can use sourceType="module" and then set classes to false explicitly to achieve what you want.

from espree.

caridy avatar caridy commented on September 24, 2024

👍

from espree.

nzakas avatar nzakas commented on September 24, 2024

I'll take a stab at the feature flag, then we can attack the other pieces.

from espree.

xjamundx avatar xjamundx commented on September 24, 2024

Oh I have PRs for the last 2 I can open I think...not sure how I missed this thread!

from espree.

nzakas avatar nzakas commented on September 24, 2024

Working on tests for sourceType="module"

from espree.

nzakas avatar nzakas commented on September 24, 2024

Wow, this is a really good test. Uncovered a few issues.

from espree.

nzakas avatar nzakas commented on September 24, 2024

All done!

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.