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

Markdown fenced code excessive useless errors #48

Open
ricardofbarros opened this issue Sep 3, 2015 · 7 comments
Open

Markdown fenced code excessive useless errors #48

ricardofbarros opened this issue Sep 3, 2015 · 7 comments

Comments

@ricardofbarros
Copy link
Owner

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*/
@ricardofbarros
Copy link
Owner Author

@blakeembrey and @despairblue What are your thoughts on this issue?

@blakeembrey
Copy link

@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.

@ricardofbarros
Copy link
Owner Author

Okay, it seems plausible having a sub option to ignore those pesty warnings.

@despairblue
Copy link
Contributor

Maybe just have a text option to enter whatever eslint options?

@blakeembrey
Copy link

@ricardofbarros The only error that I'm getting and doesn't make sense is the "newline required at end of file".

@ricardofbarros
Copy link
Owner Author

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.

@sonicdoe
Copy link
Collaborator

It would probably be best to disable the same rules standard-markdown disables.

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

5 participants
@sonicdoe @despairblue @blakeembrey @ricardofbarros and others