Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic import is stage 4 (but still doesn't work) #1339

Closed
dtudury opened this issue Jul 27, 2019 · 6 comments
Closed

dynamic import is stage 4 (but still doesn't work) #1339

dtudury opened this issue Jul 27, 2019 · 6 comments

Comments

@dtudury
Copy link

dtudury commented Jul 27, 2019

What version of standard?
13.1.0

What operating system, Node.js, and npm version?
macOS 10.14.1, v10.16.0, 6.9.0

What did you expect to happen?

54:  const _installMap = new Map()
55:  async function _installComponent (path) {
56:    if (!_installMap.has(path)) {
57:      _installMap.set(path, import(path))
58:    }
59:    return _installMap.get(path)
60:  }

works on 83.29% of browsers and is in stage 4 of the TC39 process.
I expect standard to consider it valid code

What actually happened?

$ ./node_modules/.bin/standard
standard: Use JavaScript Standard Style (https://standardjs.com)
  /Users/dtudury/Repos/dtudury/rememberism/docs/controller.js:57:27: Parsing error: Unexpected token import

I know this has been reported before (#751) but that issue is closed and locked (because dynamic import was stage 3... but now it's stage 4)

@feross
Copy link
Member

feross commented Jul 27, 2019

We're currently waiting on support from ESLint for dynamic import. See this issue: eslint/eslint#11803 And here's a in-progress PR: eslint/eslint#11983

Once that's been released, we'll update and finally get support :) In the meantime, you can use babel-eslint as a custom parser (instructions for how to set this up are in the README)

@feross feross added the blocked label Jul 27, 2019
@dtudury
Copy link
Author

dtudury commented Jul 27, 2019

sorry, yeah, I wouldn't have assumed it was your issue. however, searching the error message led to the closed issue where you kind of implied you'd fix it if it was in stage 4 😄

it sounds like the only purpose this issue serves is as a nag to merge the eslint version when it's released. (but maybe it feels good to close issues so I won't close it myself)

@feross
Copy link
Member

feross commented Jul 28, 2019

Happy to leave this issue open as a reminder to watch the ESLint issue :)

@dtudury
Copy link
Author

dtudury commented Aug 21, 2019

I just did a quick check, should this be working now? seems like everything got merged in

@feross
Copy link
Member

feross commented Aug 22, 2019

@dtudury In order to get support, we need to update to ESLint 6.2.0 or later. There's a PR for that here: #1376 but it is blocked on this bug in babel-eslint:

Once that's resolved, I'll update the version.

@feross
Copy link
Member

feross commented Aug 29, 2019

Fixed in standard@14.1.0

@feross feross closed this as completed Aug 29, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

2 participants