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

Can meriyah be used as eslint parser? #158

Open
kurtextrem opened this issue Nov 21, 2020 · 3 comments
Open

Can meriyah be used as eslint parser? #158

kurtextrem opened this issue Nov 21, 2020 · 3 comments

Comments

@kurtextrem
Copy link

kurtextrem commented Nov 21, 2020

Did not find any docu about it, might be a nice use-case?

@tunnckoCore
Copy link

tunnckoCore commented Dec 9, 2020

Yes, I remember. Or I was using buntis for a long time. I think both worked, but was using buntis because it can parse TS too.

The whole thing is that you just need to expose exports.parse (I think 🤔) method and point to that file from ESLint config/cli options.

// meriyah-parser.js
const meriyah = require('meriyah');

exports.parse = (source, options) => {
  return meriyah.parseModule(source, options);
}

and --parser ./path/to/meriyah-parser.js

If not, try just parser: 'seafox' instead of the usual @babel/parser or @typescript-eslint/parser.

@KFlash
Copy link
Contributor

KFlash commented Dec 16, 2020

@tunnckoCore are you still in a urgent need for a fast TS parser? If so, is it ok it doesn't output any AST - only the parsed source stripped for types and annotations and printed back to you with no need for EScodegen and other 3rd party tools?

@tunnckoCore
Copy link

Not that much. Didn't develop in a very long time.

It sounds good, but it's not very clear to me what you mean. But that's on me, I'm not in dev mode and it may be harder to get without thinking a bit more haha.

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

No branches or pull requests

3 participants