npm package: @svengreb/remark-preset-lint
Description: The opinionated, yet universally applicable Markdown code style guide rules as an extensible remark-lint rule preset
Author: Sven Greb
Latest version: 0.5.0

<p align="center">
  <picture>
    <source srcset="https://raw.githubusercontent.com/svengreb/assets/main/static/images/logos/projects/styleguides/markdown/remark-preset-lint/heroes/dark.svg?sanitize=true" width="100%" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" />
    <source srcset="https://raw.githubusercontent.com/svengreb/assets/main/static/images/logos/projects/styleguides/markdown/remark-preset-lint/heroes/light.svg?sanitize=true" width="100%" media="(prefers-color-scheme: dark)" />
    <img src="https://raw.githubusercontent.com/svengreb/assets/main/static/images/logos/projects/styleguides/markdown/remark-preset-lint/heroes/dark.svg?sanitize=true" width="100%" />
  </picture>
</p>

<p align="center">
  <a href="https://github.com/svengreb/styleguide-markdown/tree/main/rules" target="_blank">
    <img src="https://img.shields.io/github/release/svengreb/styleguide-markdown.svg?style=flat-square&label=Docs&colorA=4c566a&colorB=88c0d0&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI%2BCiAgICA8cGF0aCBmaWxsPSIjZDhkZWU5IiBkPSJNMTMuNzQ2IDIuODEzYS42Ny42NyAwIDAgMC0uNTU5LS4xMzNMOCAzLjg0OGwtNS4xODgtMS4xOGEuNjY5LjY2OSAwIDAgMC0uNTcuMTMzLjY3Ny42NzcgMCAwIDAtLjI0Mi41MzF2OC4xMzNjLS4wMDguMzIuMjEuNTk4LjUyLjY2OGw1LjMzMiAxLjE5OWguMjk2bDUuMzMyLTEuMmEuNjY4LjY2OCAwIDAgMCAuNTItLjY2N1YzLjMzMmEuNjU5LjY1OSAwIDAgMC0uMjU0LS41MnpNMy4zMzIgNC4xNjhsNCAuODk4djYuNzY2bC00LS44OTh6bTkuMzM2IDYuNzY2bC00IC44OThWNS4wNjZsNC0uODk4em0wIDAiLz4KPC9zdmc%2BCg%3D%3D" />
  </a>
  <a href="https://github.com/svengreb/styleguide-markdown/blob/main/changelog.md" target="_blank">
    <img src="https://img.shields.io/github/release/svengreb/styleguide-markdown.svg?style=flat-square&label=Changelog&logo=github&logoColor=eceff4&colorA=4c566a&colorB=88c0d0" />
  </a>
</p>

<p align="center">
  <a href="https://www.npmjs.com/package/@svengreb/remark-preset-lint" target="_blank">
    <img src="https://img.shields.io/npm/v/@svengreb/remark-preset-lint.svg?style=flat-square&label=npm&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI2Q4ZGVlOSIgZD0iTTEyIDE0SDRhMiAyIDAgMCAxLTItMlY0YTIgMiAwIDAgMSAyLTJoOGEyIDIgMCAwIDEgMiAydjhhMiAyIDAgMCAxLTIgMnpNNCAzLjMzMkEuNjcuNjcgMCAwIDAgMy4zMzIgNHY4YzAgLjM2Ny4zLjY2OC42NjguNjY4aDhhLjY3LjY3IDAgMCAwIC42NjgtLjY2OFY0QS42Ny42NyAwIDAgMCAxMiAzLjMzMnptMCAwIi8+PHBhdGggZmlsbD0iI2Q4ZGVlOSIgZD0iTTggNmgyLjY2OHY2LjY2OEg4em0wIDAiLz48L3N2Zz4K" />
  </a>
  <a href="https://www.npmjs.com/package/@svengreb/remark-preset-lint" target="_blank">
    <img src="https://img.shields.io/npm/dt/@svengreb/remark-preset-lint.svg?style=flat-square&label=Downloads&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZmlsbD0iI2Q4ZGVlOSIgZD0iTTEyIDE0SDRhMiAyIDAgMCAxLTItMlY0YTIgMiAwIDAgMSAyLTJoOGEyIDIgMCAwIDEgMiAydjhhMiAyIDAgMCAxLTIgMnpNNCAzLjMzMkEuNjcuNjcgMCAwIDAgMy4zMzIgNHY4YzAgLjM2Ny4zLjY2OC42NjguNjY4aDhhLjY3LjY3IDAgMCAwIC42NjgtLjY2OFY0QS42Ny42NyAwIDAgMCAxMiAzLjMzMnptMCAwIi8+PHBhdGggZmlsbD0iI2Q4ZGVlOSIgZD0iTTggNmgyLjY2OHY2LjY2OEg4em0wIDAiLz48L3N2Zz4K" />
  </a>
</p>

<p align="center">
  <a href="https://github.com/svengreb/styleguide-markdown/actions/workflows/ci-node.yaml" target="_blank">
    <img src="https://img.shields.io/github/actions/workflow/status/svengreb/styleguide-markdown/ci-node.yaml?branch=main&style=flat-square&label=CI%20Node&logoColor=eceff4&colorA=4c566a&logo=github-actions" />
  </a>
</p>

<p align="center">
  <a href="https://github.com/svengreb/styleguide-markdown/releases/latest" target="_blank">
    <img src="https://img.shields.io/github/release/svengreb/styleguide-markdown.svg?style=flat-square&label=Markdown%20Style%20Guide&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=markdown" />
  </a>
  <a href="https://github.com/arcticicestudio/styleguide-javascript/releases/latest" target="_blank">
    <img src="https://img.shields.io/github/release/arcticicestudio/styleguide-javascript.svg?style=flat-square&label=JavaScript%20Style%20Guide&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=javascript" />
  </a>
  <a href="https://github.com/svengreb/styleguide-git/releases/latest" target="_blank">
    <img src="https://img.shields.io/github/release/svengreb/styleguide-git.svg?style=flat-square&label=Git%20Style%20Guide&logoColor=eceff4&colorA=4c566a&colorB=88c0d0&logo=git" />
  </a>
</p>

<p align="center">The opinionated, yet universally applicable <a href="https://github.com/svengreb/styleguide-markdown" target="_blank">Markdown code style guide</a> rules as an extensible <a href="https://github.com/remarkjs/remark-lint" target="_blank">remark-lint</a> rule preset.</p>

This package implements the rules of the [Sven Greb Markdown style guide][1] as an extensible [remark-lint][9] rule preset. It supports all [official core rules][7] and [various plugins][4] like the [“frontmatter” Markdown extension][5] for [YAML][18] and [TOML][10] and [“GitHub Flavoured” Markdown][6].

## Getting Started

Note that this package uses [npm version 7.7.0 or higher][2] as the main package manager, but the documentations also include instructions to work with [Yarn][19] (classic / `v1`).

### Installation

Add the package as development dependency to your project:

```sh
# With npm...
npm install --save-dev @svengreb/remark-preset-lint

# or Yarn.
yarn add --dev @svengreb/remark-preset-lint
```

Note that [peer dependencies][12], like the [remark-lint][9] package itself, are **only installed automatically when using a npm version equal or higher than `7.0.0`**, otherwise they must be installed separately like described in the [peer dependencies](#peer-dependencies) section below.
See the [Node distribution index][13] for more information about which npm version is bundled with which Node version.

#### Peer Dependencies

This package depends on [various remark-lint rule packages][8] that are defined as [peer dependencies][12].

##### npm versions `>=7.0.0`

As of **npm version `7.0.0`, peer dependencies are** [**installed automatically**][3] and does not require any additional steps.

##### npm versions `>=5.0.0 <7.0.0`

For **npm version equal to or higher than `5.0.0` (pre-bundled with [Node.js 8][14]) but less than `7.0.0`**, all peer dependencies can be auto-installed using the pre-bundled [`npx`][16] package:

```sh
npx install-peerdeps --dev @svengreb/remark-preset-lint
```

##### npm versions `<5.0.0`

If you’re using a **npm version less than `5.0.0`**, the `npx` package is not pre-bundled, but users can either simply install the [`npx`][16] package globally to run the above command or use the [install-peerdeps][15] helper package locally/globally to let it handle the installation of all peer dependencies:

```sh
# Install and use the "install-peerdeps" helper package locally...
npm install install-peerdeps
./node_modules/.bin/install-peerdeps --dev @svengreb/remark-preset-lint

# ...or globally.
npm install --global install-peerdeps
install-peerdeps --dev @svengreb/remark-preset-lint
```

To install all peer dependencies manually without `npx` or any helper package, the npm `info` command can be used to get a list of all packages and their versions:

```sh
# List the names and versions of all peer dependencies...
npm info "@svengreb/remark-preset-lint" peerDependencies

# ...and install each listed package manually.
npm install PACKAGE@VERSION
```

##### Using Yarn instead of npm

If you’re not using npm but Yarn, peer dependencies can be installed by either adding them manually or using the [install-peerdeps][15] helper package:

```sh
# Either add all packages manually by listing all required names and their versions and install them manually...
yarn info @svengreb/remark-preset-lint peerDependencies
yarn add --dev remark-lint #...

# ...or use the "install-peerdeps" helper package.
yarn add --dev install-peerdeps
yarn run install-peerdeps --dev @svengreb/remark-preset-lint
```

## Usage

The package can be used as rule preset by adding it to the plugins within your `.remarkrc.js` or `.remarkrc` [configuration file][17]:

```js
module.exports = {
  plugins: ["@svengreb/remark-preset-lint"],
};
```

## Contributing

Please read the [contribution guidelines][11] of the [Sven Greb Markdown style guide][1] for more details.

<p align="center">
  <picture>
    <source srcset="https://raw.githubusercontent.com/svengreb/assets/main/static/images/elements/separators/logo/footer/dark/spaced.svg?sanitize=true" width="100%" media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)" />
    <source srcset="https://raw.githubusercontent.com/svengreb/assets/main/static/images/elements/separators/logo/footer/light/spaced.svg?sanitize=true" width="100%" media="(prefers-color-scheme: dark)" />
    <img src="https://raw.githubusercontent.com/svengreb/assets/main/static/images/elements/separators/logo/footer/dark/spaced.svg?sanitize=true" width="100%" />
  </picture>
</p>

<p align="center">
  Copyright &copy; 2016-present <a href="https://www.svengreb.de" target="_blank">Sven Greb</a>
</p>

<p align="center">
  <a href="https://github.com/svengreb/styleguide-markdown/blob/main/license" target="_blank">
    <img src="https://img.shields.io/static/v1.svg?style=flat-square&label=License&message=MIT&logoColor=eceff4&colorA=4c566a&colorB=88c0d0" />
  </a>
  <a href="https://www.svengreb.de">
    <img src="https://img.shields.io/static/v1.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAABMklEQVQ4jcWQvUoDQRRGz52s5IfVIiDWPkGKFFaCIVaGdIagjcFAwICFb7DvIK6QQlNpY2UQLMQVBbEQ0SewFkGbKCQmOzaTJay7/lR+zTAf9xwuF/47Mv45rdezqWEq72v/RWZnHgqOMwDwHMfSj085JSqb6Pu38we7r18E3nqzhmYbsE11rxKsAvhDfQiSM30XYbOw57YDwfnaRl6U3ABWaMNn806H+oGPzBX3d+4UgChZiYBHYBgGsBLoKoAyhR0x9G20Zmpc4P1ZoMQDcwMNclFrdhBKv6M5WWi7ZQGtjEUn35IV4OwnVjSX/WGmKqCDDUa5rmyle3bvGFiMg3WGUsF1u0EXHoqTRMGRgkAy2eugKZrqijRLYThWANBpNDL2h3UE0J0YLJdbrfe42f/NJ0wqY7/KcXKPAAAAAElFTkSuQmCC&label=lovely%20crafted%20in&message=Germany&colorA=4c566a&colorB=88c0d0" />
  </a>
</p>

[1]: https://github.com/svengreb/styleguide-markdown
[2]: https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli
[3]: https://github.com/npm/rfcs/blob/main/implemented/0025-install-peer-deps.md
[4]: https://github.com/remarkjs/remark/blob/main/doc/plugins.md
[5]: https://github.com/remarkjs/remark-frontmatter
[6]: https://github.com/remarkjs/remark-gfm
[7]: https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules
[8]: https://github.com/remarkjs/remark-lint/tree/main/packages
[9]: https://github.com/remarkjs/remark-lint
[10]: https://github.com/toml-lang/toml
[11]: https://github.com/svengreb/.github/blob/main/contributing.md
[12]: https://nodejs.org/en/blog/npm/peer-dependencies
[13]: https://nodejs.org/dist/index.json
[14]: https://nodejs.org/dist/latest-v8.x
[15]: https://www.npmjs.com/package/install-peerdeps
[16]: https://www.npmjs.com/package/npx
[17]: https://github.com/remarkjs/remark-lint#configuring-remark-lint
[18]: https://yaml.org
[19]: https://classic.yarnpkg.com