linter-js-standard
linter-js-standard copied to clipboard
Markdown fenced code excessive useless errors
So now if you lint the markdown files you will have the following errors pop up most of the time:
-
no-unused-vars
-
no-undef
I already had pointed out this could happen and it would be annoying.
My solution is to under the hood wrap the fenced code block in the following manner:
/*eslint-disable no-unused-vars no-undef*/
{ ...code ... }
/*eslint-enable no-unused-vars no-undef*/
@blakeembrey and @despairblue What are your thoughts on this issue?
@ricardofbarros I don't have too much of an issue with excessive errors in my markdown since I try to make it runnable most of the time. Maybe if it's a config option on the module for the people who do have an issue though. Aside from that, yeah, I'm happy with a comment when needed.
Okay, it seems plausible having a sub option to ignore those pesty warnings.
Maybe just have a text option to enter whatever eslint options?
@ricardofbarros The only error that I'm getting and doesn't make sense is the "newline required at end of file".
Yeah, it doesn't make any sense at all. To ignore your error you need to have your code formatted like this:
/```js var sumthing = require('sumthing') sumthing.useAwesomeApi()
/```
That's why I feel strongly about having a small list of rules disabled (as of now 3) when we are linting fenced code blocks.
It would probably be best to disable the same rules standard-markdown disables.