remark-preset-lint-recommended
!Buildbuild-badgebuild
!Coveragecoverage-badgecoverage
!Downloadsdownloads-badgedownloads
!Sizesize-badgesize
!Sponsorssponsors-badgecollective
!Backersbackers-badgecollective
!Chatchat-badgechatPreset of
remark-lint
mono rules to warn for some likely problems.Contents
* [`unified().use(remarkPresetLintRecommended)`](#unifieduseremarkpresetlintrecommended)
What is this?
This package is a unified (remark) preset, specifically consisting ofremark-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 configuresremark-lint
mono with the following rules:| Rule | Setting | | - | - | |
remark-lint-final-newline
| |
| remark-lint-list-item-bullet-indent
| |
| remark-lint-list-item-indent
| 'tab-size'
|
| remark-lint-no-blockquote-without-marker
| |
| remark-lint-no-literal-urls
| |
| remark-lint-ordered-list-marker-style
| '.'
|
| remark-lint-hard-break-spaces
| |
| remark-lint-no-duplicate-definitions
| |
| remark-lint-no-heading-content-indent
| |
| remark-lint-no-inline-padding
| |
| remark-lint-no-shortcut-reference-image
| |
| remark-lint-no-shortcut-reference-link
| |
| remark-lint-no-undefined-references
| |
| remark-lint-no-unused-definitions
| |Install
This package is ESM onlyesm. 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 isremarkPresetLintRecommended
.unified().use(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
Seecontributing.md
contributing in remarkjs/.github
health for ways
to get started.
See support.md
support for ways to get help.This project has a code of conductcoc. By interacting with this repository, organization, or community you agree to abide by its terms.