What is remark-preset-lint-recommended?
The remark-preset-lint-recommended package is a preset configuration for remark-lint, a tool used to lint Markdown files. It includes a set of recommended rules to ensure consistent and error-free Markdown content.
What are remark-preset-lint-recommended's main functionalities?
Linting for Markdown
This configuration file sets up remark-lint with the recommended preset. It ensures that your Markdown files adhere to a set of best practices and common standards.
module.exports = {
"plugins": [
["remark-lint", [
require("remark-preset-lint-recommended")
]]
]
};
Integration with remark
This code demonstrates how to integrate the recommended linting rules directly into a remark processing pipeline. It processes a Markdown string and applies the linting rules.
const remark = require('remark');
const recommended = require('remark-preset-lint-recommended');
remark()
.use(recommended)
.process('# Hello world!', function (err, file) {
if (err) throw err;
console.log(String(file));
});
Other packages similar to remark-preset-lint-recommended
remark-lint
remark-lint is the core linter for Markdown files. It provides the base functionality for linting and can be extended with various plugins, including remark-preset-lint-recommended. It is more flexible but requires manual configuration of rules.
remark-preset-lint-consistent
remark-preset-lint-consistent is another preset for remark-lint that focuses on consistent Markdown formatting. It includes a different set of rules compared to remark-preset-lint-recommended, aimed at ensuring uniformity in Markdown files.
remark-preset-lint-markdown-style-guide
remark-preset-lint-markdown-style-guide is a preset that enforces the rules defined by the Markdown style guide. It is more opinionated and comprehensive compared to remark-preset-lint-recommended, making it suitable for projects that follow the style guide strictly.
Preset of remark-lint
rules to warn for some likely problems.
Contents
What is this?
This package is a unified (remark) preset, specifically consisting of
remark-lint
rules.
Lint rules check markdown code style.
When should I use this?
You can use this package to check that markdown follows some best practices.
Rules
This preset configures remark-lint
with the following rules:
Install
This package is ESM only.
In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:
npm install remark-preset-lint-recommended
In Deno with Skypack:
import remarkPresetLintRecommended from 'https://cdn.skypack.dev/remark-preset-lint-recommended@6?dts'
In browsers with Skypack:
<script type="module">
import remarkPresetLintRecommended from 'https://cdn.skypack.dev/remark-preset-lint-recommended@6?min'
</script>
Use
On the API:
import {read} from 'to-vfile'
import {reporter} from 'vfile-reporter'
import {remark} from 'remark'
import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
main()
async function main() {
const file = await remark()
.use(remarkPresetLintRecommended)
.process(await read('example.md'))
console.error(reporter(file))
}
On the CLI:
remark --use remark-preset-lint-recommended example.md
On the CLI in a config file (here a package.json
):
…
"remarkConfig": {
"plugins": [
…
+ "remark-preset-lint-recommended",
…
]
}
…
API
This package exports no identifiers.
The default export is remarkPresetLintRecommended
.
Use the preset.
Presets don’t have options.
You can reconfigure rules in them by using the afterwards with different
options.
Compatibility
Projects maintained by the unified collective are compatible with all maintained
versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
Our projects sometimes work with older versions, but this is not guaranteed.
Contribute
See contributing.md
in remarkjs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct.
By interacting with this repository, organization, or community you agree to
abide by its terms.
License
MIT © Titus Wormer