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

Add standard-markdown to lint js code in markdown files #411

Merged
merged 1 commit into from
May 2, 2017

Conversation

manidlou
Copy link
Collaborator

Added standard-markdown to lint js code blocks inside our markdown files. Since standard-markdown uses standard, we have a consistent linter for both js and markdown files.

standard-markdown by default comes with a few eslint rules disabled. Just added one more rule handle-callback-err to the list of disabledRules in standard-markdown source code. I guess for us, it makes sense to disable that rule on markdown files.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.925% when pulling 01d10b3 on markdown-linter into 096a8e1 on master.

@manidlou
Copy link
Collaborator Author

manidlou commented Apr 29, 2017

Aah what a dumb I am! 😆 I have to work on it a little more. Need to find a way to programmatically add disabledRules to standard-markdown. Maybe I should fork it and apply changes based on our needs!

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.925% when pulling 6c27b6f on markdown-linter into 096a8e1 on master.

@manidlou
Copy link
Collaborator Author

So Added tools directory to contain standard-markdown fork. Updated .gitignore and .npmignore accordingly. Please let me know if I am doing anything incorrectly here!

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.925% when pulling 04b8933 on markdown-linter into 096a8e1 on master.

@manidlou
Copy link
Collaborator Author

Alright now it's fixed! 😁

@RyanZim
Copy link
Collaborator

RyanZim commented Apr 29, 2017

Hey @manidlou; thanks for putting in the effort here.

I don't like the idea of maintaining a fork here though. I think perhaps we should propose that standard-markdown disables this rule globally, since it does make sense in some cases.

How many cases does this rule fail? If it's not too much work, I wouldn't mind changing a few examples to work around this.

@manidlou
Copy link
Collaborator Author

manidlou commented Apr 30, 2017

Thanks @RyanZim. I like your approach toward this since I essentially propose this as an idea

I don't like the idea of maintaining a fork here though. 👍

Yeah, I am with you on that

I think perhaps we should propose that standard-markdown disables this rule globally, since it does make sense in some cases.

That or propose the idea of make disabledRules configurable by the user; something like a property in package.json similar to standard.

How many cases does this rule fail? If it's not too much work, I wouldn't mind changing a few examples to work around this.

Currently, when I run it without disabling handle-callback-err, 16 of them get this error. Here is the output copied from my terminal:

Linting file 30 of 30


   docs/copy.md
         37:8:     Expected error to be handled.

   docs/emptyDir.md
         27:8:     Expected error to be handled.

   docs/ensureDir.md
         26:8:     Expected error to be handled.

   docs/ensureFile.md
         26:8:     Expected error to be handled.

   docs/ensureLink.md
         26:8:     Expected error to be handled.

   docs/ensureSymlink.md
         27:8:     Expected error to be handled.

   docs/move.md
         26:8:     Expected error to be handled.

   docs/outputFile.md
         19:29:    Expected error to be handled.
         30:8:     Expected error to be handled.

   docs/outputJson.md
         22:21:    Expected error to be handled.
         33:8:     Expected error to be handled.

   docs/readJson.md
         28:8:     Expected error to be handled.
         55:8:     Expected error to be handled.

   docs/remove.md
         31:8:     Expected error to be handled.

   docs/writeJson.md
         29:8:     Expected error to be handled.

   README.md
         75:10:    Expected error to be handled.

@manidlou
Copy link
Collaborator Author

For now, I will fix those cases.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.925% when pulling 0c22802 on markdown-linter into 096a8e1 on master.

Copy link
Collaborator

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; Thanks!

@RyanZim
Copy link
Collaborator

RyanZim commented May 1, 2017

@manidlou Can you rebase this into one commit? We don't want the fork in the git history.

Copy link
Collaborator

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I just noticed; your Travis config is running more containers than needed. Why don't you just add standard-markdown to the lint script & revert your .travis.yml changes?

@manidlou
Copy link
Collaborator Author

manidlou commented May 1, 2017

@manidlou Can you rebase this into one commit? We don't want the fork in the git history. 👍

One thing I just noticed; your Travis config is running more containers than needed. Why don't you just add standard-markdown to the lint script & revert your .travis.yml changes? 👍

Sure thing. Just don't have access to computer now. I'll do them when I go home tonight.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.925% when pulling c2ab3c5 on markdown-linter into 096a8e1 on master.

@manidlou
Copy link
Collaborator Author

manidlou commented May 2, 2017

Rebase is done. Please let me know if I missed anything 😜

@jprichardson
Copy link
Owner

Looks good @manidlou, thanks!

@RyanZim RyanZim merged commit f26a946 into master May 2, 2017
@manidlou manidlou deleted the markdown-linter branch May 2, 2017 14:29
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

Successfully merging this pull request may close these issues.

4 participants