remark-lint-no-heading-like-paragraph
Advanced tools
Comparing version 3.1.0 to 3.1.1
export default remarkLintNoHeadingLikeParagraph | ||
export type Root = import('mdast').Root | ||
declare const remarkLintNoHeadingLikeParagraph: import('unified').Plugin< | ||
| void[] | ||
| [unknown] | ||
| void[] | ||
| [ | ||
( | ||
| boolean | ||
| import('unified-lint-rule').Label | ||
| import('unified-lint-rule').Severity | ||
| import('unified-lint-rule').Label | ||
), | ||
@@ -12,0 +12,0 @@ unknown |
17
index.js
/** | ||
* ## When should I use this? | ||
* | ||
* You can use this package to ensure that no heading-like constructs are | ||
* created, which instead will result in paragraphs with the `#` characters | ||
* shown. | ||
* | ||
* ## API | ||
* | ||
* There are no options. | ||
* | ||
* @module no-heading-like-paragraph | ||
* @summary | ||
* remark-lint rule to warn when h7+ “headings” are used. | ||
* @author Titus Wormer | ||
* @copyright 2015 Titus Wormer | ||
* @license MIT | ||
* @module no-heading-like-paragraph | ||
* @fileoverview | ||
* Warn for h7+ “headings”. | ||
* | ||
* @example | ||
@@ -10,0 +19,0 @@ * {"name": "ok.md"} |
{ | ||
"name": "remark-lint-no-heading-like-paragraph", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "remark-lint rule to for too many hashes (h7+ “headings”)", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
168
readme.md
@@ -13,57 +13,87 @@ <!--This file is generated--> | ||
Warn for h7+ “headings”. | ||
[`remark-lint`][mono] rule to warn when h7+ “headings” are used. | ||
## Presets | ||
## Contents | ||
This rule is not included in any default preset | ||
* [What is this?](#what-is-this) | ||
* [When should I use this?](#when-should-i-use-this) | ||
* [Presets](#presets) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
* [`unified().use(remarkLintNoHeadingLikeParagraph[, config])`](#unifieduseremarklintnoheadinglikeparagraph-config) | ||
* [Examples](#examples) | ||
* [Compatibility](#compatibility) | ||
* [Contribute](#contribute) | ||
* [License](#license) | ||
## Example | ||
## What is this? | ||
##### `ok.md` | ||
This package is a [unified][] ([remark][]) plugin, specifically a `remark-lint` | ||
rule. | ||
Lint rules check markdown code style. | ||
###### In | ||
## When should I use this? | ||
```markdown | ||
###### Alpha | ||
You can use this package to ensure that no heading-like constructs are | ||
created, which instead will result in paragraphs with the `#` characters | ||
shown. | ||
Bravo. | ||
``` | ||
## Presets | ||
###### Out | ||
This rule is not included in a preset maintained here. | ||
No messages. | ||
## Install | ||
##### `not-ok.md` | ||
This package is [ESM only][esm]. | ||
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]: | ||
###### In | ||
```sh | ||
npm install remark-lint-no-heading-like-paragraph | ||
``` | ||
```markdown | ||
####### Charlie | ||
In Deno with [Skypack][]: | ||
Delta. | ||
```js | ||
import remarkLintNoHeadingLikeParagraph from 'https://cdn.skypack.dev/remark-lint-no-heading-like-paragraph@3?dts' | ||
``` | ||
###### Out | ||
In browsers with [Skypack][]: | ||
```text | ||
1:1-1:16: This looks like a heading but has too many hashes | ||
```html | ||
<script type="module"> | ||
import remarkLintNoHeadingLikeParagraph from 'https://cdn.skypack.dev/remark-lint-no-heading-like-paragraph@3?min' | ||
</script> | ||
``` | ||
## Install | ||
## Use | ||
This package is [ESM only][esm]: | ||
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d. | ||
On the API: | ||
[npm][]: | ||
```js | ||
import {read} from 'to-vfile' | ||
import {reporter} from 'vfile-reporter' | ||
import {remark} from 'remark' | ||
import remarkLint from 'remark-lint' | ||
import remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph' | ||
```sh | ||
npm install remark-lint-no-heading-like-paragraph | ||
main() | ||
async function main() { | ||
const file = await remark() | ||
.use(remarkLint) | ||
.use(remarkLintNoHeadingLikeParagraph) | ||
.process(await read('example.md')) | ||
console.error(reporter(file)) | ||
} | ||
``` | ||
This package exports no identifiers. | ||
The default export is `remarkLintNoHeadingLikeParagraph`. | ||
On the CLI: | ||
## Use | ||
```sh | ||
remark --use remark-lint --use remark-lint-no-heading-like-paragraph example.md | ||
``` | ||
You probably want to use it on the CLI through a config file: | ||
On the CLI in a config file (here a `package.json`): | ||
@@ -75,4 +105,4 @@ ```diff | ||
… | ||
"lint", | ||
+ "lint-no-heading-like-paragraph", | ||
"remark-lint", | ||
+ "remark-lint-no-heading-like-paragraph", | ||
… | ||
@@ -84,25 +114,53 @@ ] | ||
Or use it on the CLI directly | ||
## API | ||
```sh | ||
remark -u lint -u lint-no-heading-like-paragraph readme.md | ||
This package exports no identifiers. | ||
The default export is `remarkLintNoHeadingLikeParagraph`. | ||
### `unified().use(remarkLintNoHeadingLikeParagraph[, config])` | ||
This rule supports standard configuration that all remark lint rules accept | ||
(such as `false` to turn it off or `[1, options]` to configure it). | ||
There are no options. | ||
## Examples | ||
##### `ok.md` | ||
###### In | ||
```markdown | ||
###### Alpha | ||
Bravo. | ||
``` | ||
Or use this on the API: | ||
###### Out | ||
```diff | ||
import {remark} from 'remark' | ||
import {reporter} from 'vfile-reporter' | ||
import remarkLint from 'remark-lint' | ||
import remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph' | ||
No messages. | ||
remark() | ||
.use(remarkLint) | ||
+ .use(remarkLintNoHeadingLikeParagraph) | ||
.process('_Emphasis_ and **importance**') | ||
.then((file) => { | ||
console.error(reporter(file)) | ||
}) | ||
##### `not-ok.md` | ||
###### In | ||
```markdown | ||
####### Charlie | ||
Delta. | ||
``` | ||
###### Out | ||
```text | ||
1:1-1:16: This looks like a heading but has too many hashes | ||
``` | ||
## 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 | ||
@@ -148,4 +206,12 @@ | ||
[unified]: https://github.com/unifiedjs/unified | ||
[remark]: https://github.com/remarkjs/remark | ||
[mono]: https://github.com/remarkjs/remark-lint | ||
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c | ||
[skypack]: https://www.skypack.dev | ||
[npm]: https://docs.npmjs.com/cli/install | ||
@@ -155,7 +221,7 @@ | ||
[contributing]: https://github.com/remarkjs/.github/blob/HEAD/contributing.md | ||
[contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md | ||
[support]: https://github.com/remarkjs/.github/blob/HEAD/support.md | ||
[support]: https://github.com/remarkjs/.github/blob/main/support.md | ||
[coc]: https://github.com/remarkjs/.github/blob/HEAD/code-of-conduct.md | ||
[coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md | ||
@@ -162,0 +228,0 @@ [license]: https://github.com/remarkjs/remark-lint/blob/main/license |
8702
84
226