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

fix: Hack to allow to level wait in ESLint parser #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nschonni
Copy link

This seems to be the only plugin I found that seems to work for EJS, but ran into an issue with templates using top level await statements.
ESLint won't support them till they become fully supported by TC39, so you get alot of error Parsing error: Unexpected token wiki for any statements follow an await. This hack just let's ESLint pretend they aren't there and continue processing the code

@coveralls
Copy link

Pull Request Test Coverage Report for Build 70

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 2.778%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/index.js 0 1 0.0%
Totals Coverage Status
Change from base Build 4: 0.0%
Covered Lines: 5
Relevant Lines: 120

💛 - Coveralls

@overlookmotel
Copy link
Owner

Hi. I hacked this together years ago but never ended up using it, so it's pretty low quality. There are no tests and I never got round to writing docs. I wasn't aware anyone was using it!

Anyway, have you tried using babel-eslint as parser in ESLint config? That'll allow ESLint to support top level await syntax. You should then find this hack is unnecessary. I think that'd be a better way to solve your problem than this PR.

@nschonni
Copy link
Author

Yeah, unfortunately the babel-parser doesn't seem to work in this case, possibly because of the EJS tags, so I ended up using this library with a package-patch in mdn/yari#2492

No worries if you don't want to land this, figured I'd share it in case someone else hit the issue as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants