Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Question: 11.0.0-beta2 Not installing all babel plugins (top level await) #834

Closed
Sceat opened this issue May 20, 2020 · 1 comment
Closed

Comments

@Sceat
Copy link

Sceat commented May 20, 2020

I'm not using babel to transpile the code but only babel-eslint to allow linting the code. I went on the >11 version as nodejs 14.3 released a working top level await with a flag and i couldn't make it work with babel-eslint 10.

By upgrading to babel-eslint 11 i now have to install every babel plugin to use experimental features even though they are supported by node. That was not the case before 11

Support for the experimental syntax 'importMeta' isn't currently enabled

same for static class properties etc

Question

Is there a way to include all features like the 10 behavior without installing many plugins while still using top level await ?

My eslint config

env:
  node: true
  es2020: true
plugins:
  - unicorn
extends:
  - "@sidy/eslint-config-sidy"
globals:
  Atomics: readonly
  SharedArrayBuffer: readonly
parser: babel-eslint
parserOptions:
  sourceType: module
  configFile: package.json
  ecmaVersion: 11

My current babel config

tough i'd like to have none and directly support top level await with allowAwaitoutsideFunction inside the eslintconfig

# package.json

  "babel": {
    "parserOpts": {
      "allowAwaitOutsideFunction": true
    },
    "plugins": [
      "@babel/plugin-proposal-class-properties",
      "@babel/plugin-proposal-numeric-separator"
    ]
  },
@kaicataldo
Copy link
Member

You can follow this discussion, as it should allow for you to do this once implemented. Please note that all development has moved to https://github.com/babel/babel.

@Sceat Sceat closed this as completed May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants