Socket
Socket
Sign inDemoInstall

remark-preset-lint-recommended

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-preset-lint-recommended - npm Package Compare versions

Comparing version 5.0.0 to 6.1.2

index.d.ts

76

index.js
/**
* @fileoverview
* remark preset to configure `remark-lint` with settings that prevent
* mistakes or syntaxes that do not work correctly across vendors.
* ## When should I use this?
*
* You can use this package to check that markdown follows some best practices.
*
* @summary
* Preset of remark-lint rules to warn for some likely problems.
*/
'use strict'
/**
* @typedef {import('unified').Preset} Preset
*/
module.exports.plugins = [
require('remark-lint'),
// Unix compatibility.
require('remark-lint-final-newline'),
// Rendering across vendors differs greatly if using other styles.
require('remark-lint-list-item-bullet-indent'),
[require('remark-lint-list-item-indent'), 'tab-size'],
// Differs or unsupported across vendors.
require('remark-lint-no-auto-link-without-protocol'),
require('remark-lint-no-blockquote-without-marker'),
require('remark-lint-no-literal-urls'),
[require('remark-lint-ordered-list-marker-style'), '.'],
// Mistakes.
require('remark-lint-hard-break-spaces'),
require('remark-lint-no-duplicate-definitions'),
require('remark-lint-no-heading-content-indent'),
require('remark-lint-no-inline-padding'),
require('remark-lint-no-shortcut-reference-image'),
require('remark-lint-no-shortcut-reference-link'),
require('remark-lint-no-undefined-references'),
require('remark-lint-no-unused-definitions')
]
import remarkLint from 'remark-lint'
import remarkLintFinalNewline from 'remark-lint-final-newline'
import remarkLintListItemBulletIndent from 'remark-lint-list-item-bullet-indent'
import remarkLintListItemIndent from 'remark-lint-list-item-indent'
import remarkLintNoBlockquoteWithoutMarker from 'remark-lint-no-blockquote-without-marker'
import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls'
import remarkLintOrderedListMarkerStyle from 'remark-lint-ordered-list-marker-style'
import remarkLintHardBreakSpaces from 'remark-lint-hard-break-spaces'
import remarkLintNoDuplicateDefinitions from 'remark-lint-no-duplicate-definitions'
import remarkLintNoHeadingContentIndent from 'remark-lint-no-heading-content-indent'
import remarkLintNoInlinePadding from 'remark-lint-no-inline-padding'
import remarkLintNoShortcutReferenceImage from 'remark-lint-no-shortcut-reference-image'
import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link'
import remarkLintNoUndefinedReferences from 'remark-lint-no-undefined-references'
import remarkLintNoUnusedDefinitions from 'remark-lint-no-unused-definitions'
/** @type {Preset} */
const remarkPresetLintRecommended = {
plugins: [
remarkLint,
// Unix compatibility.
remarkLintFinalNewline,
// Rendering across vendors differs greatly if using other styles.
remarkLintListItemBulletIndent,
[remarkLintListItemIndent, 'tab-size'],
remarkLintNoBlockquoteWithoutMarker,
remarkLintNoLiteralUrls,
[remarkLintOrderedListMarkerStyle, '.'],
// Mistakes.
remarkLintHardBreakSpaces,
remarkLintNoDuplicateDefinitions,
remarkLintNoHeadingContentIndent,
remarkLintNoInlinePadding,
remarkLintNoShortcutReferenceImage,
remarkLintNoShortcutReferenceLink,
remarkLintNoUndefinedReferences,
remarkLintNoUnusedDefinitions
]
}
export default remarkPresetLintRecommended
{
"name": "remark-preset-lint-recommended",
"version": "5.0.0",
"description": "remark preset to configure remark-lint with rules that prevent mistakes or syntaxes that do not work correctly across vendors",
"version": "6.1.2",
"description": "remark preset to configure remark-lint with rules that prevent mistakes or stuff that fails across vendors.",
"license": "MIT",

@@ -12,3 +12,7 @@ "keywords": [

],
"repository": "https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-recommended",
"repository": {
"type": "git",
"url": "https://github.com/remarkjs/remark-lint",
"directory": "packages/remark-preset-lint-recommended"
},
"bugs": "https://github.com/remarkjs/remark-lint/issues",

@@ -23,24 +27,39 @@ "funding": {

],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.d.ts",
"index.js"
],
"dependencies": {
"remark-lint": "^8.0.0",
"remark-lint-final-newline": "^1.0.0",
"remark-lint-list-item-bullet-indent": "^3.0.0",
"remark-lint-list-item-indent": "^2.0.0",
"remark-lint-no-auto-link-without-protocol": "^2.0.0",
"remark-lint-no-blockquote-without-marker": "^4.0.0",
"remark-lint-no-literal-urls": "^2.0.0",
"remark-lint-ordered-list-marker-style": "^2.0.0",
"remark-lint-hard-break-spaces": "^2.0.0",
"remark-lint-no-duplicate-definitions": "^2.0.0",
"remark-lint-no-heading-content-indent": "^3.0.0",
"remark-lint-no-inline-padding": "^3.0.0",
"remark-lint-no-shortcut-reference-image": "^2.0.0",
"remark-lint-no-shortcut-reference-link": "^2.0.0",
"remark-lint-no-undefined-references": "^3.0.0",
"remark-lint-no-unused-definitions": "^2.0.0"
"@types/mdast": "^3.0.0",
"remark-lint": "^9.0.0",
"remark-lint-final-newline": "^2.0.0",
"remark-lint-hard-break-spaces": "^3.0.0",
"remark-lint-list-item-bullet-indent": "^4.0.0",
"remark-lint-list-item-indent": "^3.0.0",
"remark-lint-no-blockquote-without-marker": "^5.0.0",
"remark-lint-no-duplicate-definitions": "^3.0.0",
"remark-lint-no-heading-content-indent": "^4.0.0",
"remark-lint-no-inline-padding": "^4.0.0",
"remark-lint-no-literal-urls": "^3.0.0",
"remark-lint-no-shortcut-reference-image": "^3.0.0",
"remark-lint-no-shortcut-reference-link": "^3.0.0",
"remark-lint-no-undefined-references": "^4.0.0",
"remark-lint-no-unused-definitions": "^3.0.0",
"remark-lint-ordered-list-marker-style": "^3.0.0",
"unified": "^10.0.0"
},
"xo": false
"scripts": {
"build": "rimraf \"*.d.ts\" && tsc && type-coverage"
},
"xo": false,
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true,
"ignoreCatch": true
}
}

@@ -13,30 +13,52 @@ <!--This file is generated-->

remark preset to configure `remark-lint` with settings that prevent
mistakes or syntaxes that do not work correctly across vendors.
Preset of [`remark-lint`][mono] rules to warn for some likely problems.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Rules](#rules)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`unified().use(remarkPresetLintRecommended)`](#unifieduseremarkpresetlintrecommended)
* [Compatibility](#compatibility)
* [Contribute](#contribute)
* [License](#license)
## 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`](https://github.com/remarkjs/remark-lint) with the following rules:
This preset configures [`remark-lint`][mono] with the following rules:
| Rule | Setting |
| - | - |
| [`final-newline`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-final-newline) | |
| [`list-item-bullet-indent`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-list-item-bullet-indent) | |
| [`list-item-indent`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-list-item-indent) | `'tab-size'` |
| [`no-auto-link-without-protocol`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-auto-link-without-protocol) | |
| [`no-blockquote-without-marker`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-blockquote-without-marker) | |
| [`no-literal-urls`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-literal-urls) | |
| [`ordered-list-marker-style`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-ordered-list-marker-style) | `'.'` |
| [`hard-break-spaces`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-hard-break-spaces) | |
| [`no-duplicate-definitions`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-duplicate-definitions) | |
| [`no-heading-content-indent`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-heading-content-indent) | |
| [`no-inline-padding`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-inline-padding) | |
| [`no-shortcut-reference-image`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-shortcut-reference-image) | |
| [`no-shortcut-reference-link`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-shortcut-reference-link) | |
| [`no-undefined-references`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-undefined-references) | |
| [`no-unused-definitions`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-unused-definitions) | |
| [`remark-lint-final-newline`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-final-newline) | |
| [`remark-lint-list-item-bullet-indent`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-list-item-bullet-indent) | |
| [`remark-lint-list-item-indent`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-list-item-indent) | `'tab-size'` |
| [`remark-lint-no-blockquote-without-marker`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-blockquote-without-marker) | |
| [`remark-lint-no-literal-urls`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-literal-urls) | |
| [`remark-lint-ordered-list-marker-style`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-ordered-list-marker-style) | `'.'` |
| [`remark-lint-hard-break-spaces`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-hard-break-spaces) | |
| [`remark-lint-no-duplicate-definitions`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-duplicate-definitions) | |
| [`remark-lint-no-heading-content-indent`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-heading-content-indent) | |
| [`remark-lint-no-inline-padding`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-inline-padding) | |
| [`remark-lint-no-shortcut-reference-image`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-shortcut-reference-image) | |
| [`remark-lint-no-shortcut-reference-link`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-shortcut-reference-link) | |
| [`remark-lint-no-undefined-references`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-undefined-references) | |
| [`remark-lint-no-unused-definitions`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-unused-definitions) | |
## Install
[npm][]:
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:

@@ -47,10 +69,53 @@ ```sh

In Deno with [Skypack][]:
```js
import remarkPresetLintRecommended from 'https://cdn.skypack.dev/remark-preset-lint-recommended@6?dts'
```
In browsers with [Skypack][]:
```html
<script type="module">
import remarkPresetLintRecommended from 'https://cdn.skypack.dev/remark-preset-lint-recommended@6?min'
</script>
```
## Use
You probably want to use it on the CLI through a config file:
On the API:
```js
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:
```sh
remark --use remark-preset-lint-recommended example.md
```
On the CLI in a config file (here a `package.json`):
```diff
"remarkConfig": {
+ "plugins": ["preset-lint-recommended"]
"plugins": [
+ "remark-preset-lint-recommended",
]
}

@@ -60,21 +125,21 @@

Or use it on the CLI directly
## API
```sh
remark -u preset-lint-recommended readme.md
```
This package exports no identifiers.
The default export is `remarkPresetLintRecommended`.
Or use this on the API:
### `unified().use(remarkPresetLintRecommended)`
```diff
var remark = require('remark')
var report = require('vfile-reporter')
Use the preset.
Presets don’t have options.
You can reconfigure rules in them by using the afterwards with different
options.
remark()
+ .use(require('remark-preset-lint-recommended'))
.process('_Emphasis_ and **importance**', function (err, file) {
console.error(report(err || file))
})
```
## 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

@@ -94,5 +159,5 @@

[build-badge]: https://img.shields.io/travis/remarkjs/remark-lint/main.svg
[build-badge]: https://github.com/remarkjs/remark-lint/workflows/main/badge.svg
[build]: https://travis-ci.org/remarkjs/remark-lint
[build]: https://github.com/remarkjs/remark-lint/actions

@@ -121,2 +186,12 @@ [coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-lint.svg

[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

@@ -126,7 +201,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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc