Socket
Socket
Sign inDemoInstall

remark-lint-no-inline-padding

Package Overview
Dependencies
17
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.0 to 4.1.1

4

index.d.ts
export default remarkLintNoInlinePadding
export type Root = import('mdast').Root
declare const remarkLintNoInlinePadding: 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

/**
* ## When should I use this?
*
* You can use this package to check that inline constructs (links) are
* not padded.
* Historically, it was possible to pad emphasis, strong, and strikethrough
* too, but this was removed in CommonMark, making this rule much less useful.
*
* ## API
*
* There are no options.
*
* @module no-inline-padding
* @summary
* remark-lint rule to warn when inline constructs are padded.
* @author Titus Wormer
* @copyright 2015 Titus Wormer
* @license MIT
* @module no-inline-padding
* @fileoverview
* Warn when phrasing content is padded with spaces between their markers and
* content.
*
* Warns for emphasis, strong, delete, image, and link.
*
* @example

@@ -13,0 +20,0 @@ * {"name": "ok.md"}

{
"name": "remark-lint-no-inline-padding",
"version": "4.1.0",
"version": "4.1.1",
"description": "remark-lint rule to warn when inline nodes are padded with spaces",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -13,7 +13,31 @@ <!--This file is generated-->

Warn when phrasing content is padded with spaces between their markers and
content.
[`remark-lint`][mono] rule to warn when inline constructs are padded.
Warns for emphasis, strong, delete, image, and link.
## Contents
* [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(remarkLintNoInlinePadding[, config])`](#unifieduseremarklintnoinlinepadding-config)
* [Examples](#examples)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package is a [unified][] ([remark][]) plugin, specifically a `remark-lint`
rule.
Lint rules check markdown code style.
## When should I use this?
You can use this package to check that inline constructs (links) are
not padded.
Historically, it was possible to pad emphasis, strong, and strikethrough
too, but this was removed in CommonMark, making this rule much less useful.
## Presets

@@ -28,47 +52,55 @@

## Example
## Install
##### `ok.md`
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
###### In
```markdown
Alpha [bravo](http://echo.fox/trot)
```sh
npm install remark-lint-no-inline-padding
```
###### Out
In Deno with [Skypack][]:
No messages.
```js
import remarkLintNoInlinePadding from 'https://cdn.skypack.dev/remark-lint-no-inline-padding@4?dts'
```
##### `not-ok.md`
In browsers with [Skypack][]:
###### In
```markdown
Alpha [ bravo ](http://echo.fox/trot)
```html
<script type="module">
import remarkLintNoInlinePadding from 'https://cdn.skypack.dev/remark-lint-no-inline-padding@4?min'
</script>
```
###### Out
## Use
```text
1:7-1:38: Don’t pad `link` with inner spaces
```
On the API:
## Install
```js
import {read} from 'to-vfile'
import {reporter} from 'vfile-reporter'
import {remark} from 'remark'
import remarkLint from 'remark-lint'
import remarkLintNoInlinePadding from 'remark-lint-no-inline-padding'
This package is [ESM only][esm]:
Node 12+ is needed to use it and it must be `imported`ed instead of `required`d.
main()
[npm][]:
async function main() {
const file = await remark()
.use(remarkLint)
.use(remarkLintNoInlinePadding)
.process(await read('example.md'))
```sh
npm install remark-lint-no-inline-padding
console.error(reporter(file))
}
```
This package exports no identifiers.
The default export is `remarkLintNoInlinePadding`.
On the CLI:
## Use
```sh
remark --use remark-lint --use remark-lint-no-inline-padding 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`):

@@ -80,4 +112,4 @@ ```diff

"lint",
+ "lint-no-inline-padding",
"remark-lint",
+ "remark-lint-no-inline-padding",

@@ -89,25 +121,49 @@ ]

Or use it on the CLI directly
## API
```sh
remark -u lint -u lint-no-inline-padding readme.md
This package exports no identifiers.
The default export is `remarkLintNoInlinePadding`.
### `unified().use(remarkLintNoInlinePadding[, 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](http://echo.fox/trot)
```
Or use this on the API:
###### Out
```diff
import {remark} from 'remark'
import {reporter} from 'vfile-reporter'
import remarkLint from 'remark-lint'
import remarkLintNoInlinePadding from 'remark-lint-no-inline-padding'
No messages.
remark()
.use(remarkLint)
+ .use(remarkLintNoInlinePadding)
.process('_Emphasis_ and **importance**')
.then((file) => {
console.error(reporter(file))
})
##### `not-ok.md`
###### In
```markdown
Alpha [ bravo ](http://echo.fox/trot)
```
###### Out
```text
1:7-1:38: Don’t pad `link` with inner spaces
```
## 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

@@ -153,4 +209,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

@@ -160,7 +224,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

@@ -167,0 +231,0 @@ [license]: https://github.com/remarkjs/remark-lint/blob/main/license

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc