mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-10-27 19:58:38 +03:00
151 lines
3.3 KiB
Markdown
151 lines
3.3 KiB
Markdown
<!--This file is generated-->
|
|
|
|
# remark-lint-definition-spacing
|
|
|
|
[![Build][build-badge]][build]
|
|
[![Coverage][coverage-badge]][coverage]
|
|
[![Downloads][downloads-badge]][downloads]
|
|
[![Size][size-badge]][size]
|
|
[![Sponsors][sponsors-badge]][collective]
|
|
[![Backers][backers-badge]][collective]
|
|
[![Chat][chat-badge]][chat]
|
|
|
|
Warn when consecutive whitespace is used in a definition.
|
|
|
|
## Presets
|
|
|
|
This rule is included in the following presets:
|
|
|
|
| Preset | Setting |
|
|
| - | - |
|
|
| [`remark-preset-lint-markdown-style-guide`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-markdown-style-guide) | |
|
|
|
|
## Example
|
|
|
|
##### `ok.md`
|
|
|
|
###### In
|
|
|
|
```markdown
|
|
[example domain]: http://example.com "Example Domain"
|
|
```
|
|
|
|
###### Out
|
|
|
|
No messages.
|
|
|
|
##### `not-ok.md`
|
|
|
|
###### In
|
|
|
|
Note: `·` represents a space.
|
|
|
|
```markdown
|
|
[example····domain]: http://example.com "Example Domain"
|
|
```
|
|
|
|
###### Out
|
|
|
|
```text
|
|
1:1-1:57: Do not use consecutive whitespace in definition labels
|
|
```
|
|
|
|
## Install
|
|
|
|
[npm][]:
|
|
|
|
```sh
|
|
npm install remark-lint-definition-spacing
|
|
```
|
|
|
|
## Use
|
|
|
|
You probably want to use it on the CLI through a config file:
|
|
|
|
```diff
|
|
…
|
|
"remarkConfig": {
|
|
"plugins": [
|
|
…
|
|
"lint",
|
|
+ "lint-definition-spacing",
|
|
…
|
|
]
|
|
}
|
|
…
|
|
```
|
|
|
|
Or use it on the CLI directly
|
|
|
|
```sh
|
|
remark -u lint -u lint-definition-spacing readme.md
|
|
```
|
|
|
|
Or use this on the API:
|
|
|
|
```diff
|
|
var remark = require('remark')
|
|
var report = require('vfile-reporter')
|
|
|
|
remark()
|
|
.use(require('remark-lint'))
|
|
+ .use(require('remark-lint-definition-spacing'))
|
|
.process('_Emphasis_ and **importance**', function (err, file) {
|
|
console.error(report(err || file))
|
|
})
|
|
```
|
|
|
|
## Contribute
|
|
|
|
See [`contributing.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 conduct][coc].
|
|
By interacting with this repository, organization, or community you agree to
|
|
abide by its terms.
|
|
|
|
## License
|
|
|
|
[MIT][license] © [Titus Wormer][author]
|
|
|
|
[build-badge]: https://img.shields.io/travis/remarkjs/remark-lint/main.svg
|
|
|
|
[build]: https://travis-ci.org/remarkjs/remark-lint
|
|
|
|
[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-lint.svg
|
|
|
|
[coverage]: https://codecov.io/github/remarkjs/remark-lint
|
|
|
|
[downloads-badge]: https://img.shields.io/npm/dm/remark-lint-definition-spacing.svg
|
|
|
|
[downloads]: https://www.npmjs.com/package/remark-lint-definition-spacing
|
|
|
|
[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-lint-definition-spacing.svg
|
|
|
|
[size]: https://bundlephobia.com/result?p=remark-lint-definition-spacing
|
|
|
|
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
|
|
|
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
|
|
|
[collective]: https://opencollective.com/unified
|
|
|
|
[chat-badge]: https://img.shields.io/badge/chat-spectrum.svg
|
|
|
|
[chat]: https://spectrum.chat/unified/remark
|
|
|
|
[npm]: https://docs.npmjs.com/cli/install
|
|
|
|
[health]: https://github.com/remarkjs/.github
|
|
|
|
[contributing]: https://github.com/remarkjs/.github/blob/HEAD/contributing.md
|
|
|
|
[support]: https://github.com/remarkjs/.github/blob/HEAD/support.md
|
|
|
|
[coc]: https://github.com/remarkjs/.github/blob/HEAD/code-of-conduct.md
|
|
|
|
[license]: https://github.com/remarkjs/remark-lint/blob/main/license
|
|
|
|
[author]: https://wooorm.com
|