question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Alias the es6 env to es2015

See original GitHub issue

The version of ESLint you are using. 3.4.0

The problem you want to solve. ESLint 3.4.0 introduced new preferred numbers for the ecmaVersion property, e.g. 2015 instead od 6. The change is not reflected in the es6 environment name. My current example config is now inconsistent:

module.exports = {
    parserOptions: {
        ecmaVersion: 2016,
    },

    env: {
        es6: true,
    },

    rules: { /* ... */ },
};

Your take on the correct solution to problem. An alias env called es2015 should be created and preferred to the old es6 one.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
michaelficarracommented, Aug 30, 2016

There’s nothing wrong with the ability to write

env:
  es6: true
  es2015: false

Then the user will just get the error “Both es6 and es2015 env options were set to conflicting values. Remove one to continue.”

1reaction
btmillscommented, Sep 1, 2016

Based on discussion in the 2016-09-01 TSC meeting, we believe supporting both es6 and es2015 in parallel or renaming es6 to es2015 would be more confusing than keeping the name as-is. es6 will remain, and we will use year-based naming starting with the 2017 edition. (ES7/ES2016 introduced no new globals, so it doesn’t have its own environment.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

ES2015 aliases for ES6? · Issue #6750 · eslint/eslint - GitHub
Basically, an ability to specify ecmaVersion: 2015 that would behave just like ecmaVersion: 6 without deprecating the value 6 . And an es2015...
Read more >
ES6 Modules (ES2015) - Import and Export | egghead.io
ES6 (ES2015) introduces a standardized module format to Javascript. We'll take a look at the various forms of defining and importing modules.
Read more >
Jest cannot locate @babel/code-frame when trying to use ...
When I imported for example example.js , which has an alias'd import , Jest would throw an error, "cannot resolve module '@/widgets/widget'.
Read more >
babel/preset-env
babel /preset-env` is a smart preset that allows you to use the latest JavaScript without needing to micromanage which syntax transforms (and optionally, ......
Read more >
ES6 Tutorial - #10 Modules (import & export) - YouTube
14K views 4 years ago ES6 / ES2015 Tutorial ... named imports 7:10 Inline export 8:22 Export with an alias 10:20 Import with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found