remark-preset-lint-recommended

remark preset to configure remark-lint with rules that prevent mistakes or stuff that fails across vendors.

Usage no npm install needed!

<script type="module">
  import remarkPresetLintRecommended from 'https://cdn.skypack.dev/remark-preset-lint-recommended';
</script>

README

remark-preset-lint-recommended

Build Coverage Downloads Size Sponsors Backers Chat

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:

| 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 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.

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

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