Skip parsing disabled code sections
ehmicky opened this issue · comments
ehmicky commented
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 :)
Teddy Katz commented
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 commented
Thanks @not-an-aardvark! Sorry for not reading the README
properly :/