Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
markdownlint-cli2
Advanced tools
A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the `markdownlint` library
markdownlint-cli2 is a command-line interface for the markdownlint library, which is used to lint Markdown files. It helps ensure that Markdown files adhere to a consistent style and are free of common errors.
Linting Markdown Files
This command lints all Markdown files in the current directory and its subdirectories. It checks for common issues and style inconsistencies in Markdown files.
npx markdownlint-cli2 '**/*.md'
Using a Configuration File
This command uses a configuration file (.markdownlint.json) to specify custom linting rules. This allows for more granular control over the linting process.
npx markdownlint-cli2 '**/*.md' --config .markdownlint.json
Fixing Issues Automatically
This command not only lints the Markdown files but also attempts to fix any issues it finds automatically. This can save time by correcting common mistakes without manual intervention.
npx markdownlint-cli2-fix '**/*.md'
Ignoring Files
This command lints all Markdown files but ignores those in the node_modules directory. This is useful for excluding third-party files from the linting process.
npx markdownlint-cli2 '**/*.md' --ignore node_modules
remark-cli is a command-line interface for the remark library, which is used to process Markdown files. It offers similar functionality to markdownlint-cli2, including linting and formatting, but is part of the larger unified ecosystem, which provides a wide range of plugins for additional processing tasks.
markdownlint is the core library that markdownlint-cli2 is based on. It provides the underlying linting functionality and can be used programmatically within Node.js applications. While it does not offer a command-line interface out of the box, it can be integrated into custom scripts and build processes.
mdlint is another Markdown linter that focuses on simplicity and ease of use. It provides a basic set of linting rules and can be used as a command-line tool. While it may not be as feature-rich as markdownlint-cli2, it is a good option for users who need a straightforward linting solution.
A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the
markdownlint
library
npm install markdownlint-cli2 --save-dev
Note:
markdownlint-cli2
is under development and is not yet as capable asmarkdownlint-cli
.
markdownlint
is a library for linting Markdown/
CommonMark files on Node.js.markdownlint-cli
is a traditional command-line interface
for markdownlint
.markdownlint-cli2
is a slightly unconventional
command-line interface for markdownlint
.markdownlint-cli2
is configuration-based and prioritizes both speed and
simplicity.markdownlint-cli2
is mostly compatible with the features of
markdownlint-cli
.vscode-markdownlint
is a markdownlint
extension for
the Visual Studio Code editor.markdownlint-cli2
is meant to work well in conjunction with
vscode-markdownlint
.markdownlint-cli2 version X.Y.Z by David Anson (https://dlaa.me/)
https://github.com/DavidAnson/markdownlint-cli2
Syntax: markdownlint-cli2 glob0 [glob1] [...] [globN]
Glob expressions (from the globby library):
- * matches any number of characters, but not /
- ? matches a single character, but not /
- ** matches any number of characters, including / (when it's the only thing in a path part)
- {} allows for a comma-separated list of "or" expressions
- ! or # at the beginning of a pattern negate the match
Configuration:
- Via .markdownlint-cli2.jsonc, .markdownlint.jsonc, .markdownlint.json, .markdownlint.yaml, or .markdownlint.yml
Cross-platform compatibility:
- UNIX and Windows shells expand globs according to different rules, so quoting glob arguments is recommended
- Shells that expand globs do not support negated patterns (!node_modules), so quoting negated globs is required
- Some Windows shells do not handle single-quoted (') arguments correctly, so double-quotes (") are recommended
- Some UNIX shells handle exclamation (!) in double-quotes specially, so hashtag (#) is recommended for negated globs
- Some shells use backslash (\) to escape special characters, so forward slash (/) is the recommended path separator
Therefore, the most compatible syntax for cross-platform support:
markdownlint-cli2 "**/*.md" "#node_modules"
0
: Linting was successful and there were no errors1
: Linting was successful and there were errors2
: Linting was not completed due to a runtime issuemarkdownlint
documentation.markdownlint
documentation for information about the inline comment syntax..markdownlintignore
.npmignore
and consists
of one glob pattern per line.!
) and appended to the
end of the command-line arguments.#
character are ignored..markdownlint-cli2.jsonc
markdownlint
options
object.config
: The markdownlint
config
object
jsonc
/json
/yaml
/yml
file (see below) is present in the same
directory, it overrides this value..markdownlint.jsonc
/ .markdownlint.json
markdownlint
config
object.jsonc
version takes
precedence.extends
property (documented above)..markdownlint.yaml
/ .markdownlint.yml
markdownlint
's config
object.jsonc
/json
files described above.yaml
version takes
precedence.jsonc
or json
file is present, it takes precedence according the
rules above.markdownlint-cli
.markdownlintignore
patterns is different.INI
config format and .markdownlintrc
are not supported.vscode-markdownlint
.markdownlintignore
patterns is different..markdownlintrc
is not supported as a configuration file.FAQs
A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the `markdownlint` library
The npm package markdownlint-cli2 receives a total of 115,666 weekly downloads. As such, markdownlint-cli2 popularity was classified as popular.
We found that markdownlint-cli2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.