Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature
What is the current behavior? (You can also link to an open issue here)
Markdown files in
node_module/
are not ignored. Since the likelihood of malformed files from third-party vendors is significantly high, especially for larger packages, users must manually addnode_modules/
to the list of ignored folders to avoid false positives when runningmarkdownlint
.What is the new behavior (if this is a feature change)?
This PR adds
node_modules
as the default value for the--ignore
flag.Since files in this folder are outside the control of the package running
markdownlint
, it makes no sense not to ignore them by default. This is exactly the reason why other linters like ESLint or Stylelint also ignorenode_modules/
by default (see the linked issue for references).While not empirically correct, searching in (public) code on GitHub shows that of the ~11k usages of the tool (https://github.com/search?q=markdownlint-cli+path%3Apackage.json&type=code), there are ~9k occurrences of "markdownlint ignore node_modules" (https://github.com/search?q=markdownlint+ignore+node_modules&type=code), indicating that the absolute majority of users don't want to scan this folder.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No. If people use
node_modules/
incorrectly, they won't know if they are writing malformed Markdown there. However, it can be assumed that developers using markdownlint know what this folder is for.Other information:
Fixes #405, fixes #459
CC @Chrico