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

Skip parsing disabled code sections #113

Closed
ehmicky opened this issue Mar 7, 2019 · 2 comments
Closed

Skip parsing disabled code sections #113

ehmicky opened this issue Mar 7, 2019 · 2 comments
Labels

Comments

@ehmicky
Copy link

ehmicky commented Mar 7, 2019

Let's say I have a module dummy that returns a promise. I might want to document it like this:

`dummy` returns a promise and take an options object as argument:

``​`js
const returnValue = await dummy(options)
``​`

This throws an exception because espree does not allow top-level await.

A possible solution to this problem would be to skip parsing code sections that are skipped with a <!-- eslint-disable --> comment. Any other solution to this problem would work as well :)

@not-an-aardvark
Copy link
Member

It seems like you're looking for the <!-- eslint-skip --> directive -- based on the readme, it seems like that directive has the effect of not parsing the code sample.

@ehmicky
Copy link
Author

ehmicky commented Mar 18, 2019

Thanks @not-an-aardvark! Sorry for not reading the README properly :/

@ehmicky ehmicky closed this as completed Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants