Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remark-lint-maximum-line-length

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-lint-maximum-line-length

remark-lint rule to warn when lines are too long

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65K
decreased by-31.21%
Maintainers
2
Weekly downloads
 
Created
Source

remark-lint-maximum-line-length

Build Coverage Downloads Size Sponsors Backers Chat

Warn when lines are too long.

Options: number, default: 80.

Ignores nodes that cannot be wrapped, such as headings, tables, code, definitions, HTML, and JSX.

Ignores images, links, and inline code if they start before the wrap, end after the wrap, and there’s no whitespace after them.

Presets

This rule is included in the following presets:

PresetSetting
remark-preset-lint-markdown-style-guide80

Example

ok-mixed-line-endings.md

When configured with 10.

In

Note: ␍␊ represents a carriage return and a line feed.

Note: represents a line feed.

0123456789␍␊
0123456789␊
01234␍␊
01234␊
Out

No messages.

not-ok-mixed-line-endings.md

When configured with 10.

In

Note: ␍␊ represents a carriage return and a line feed.

Note: represents a line feed.

012345678901␍␊
012345678901␊
01234567890␍␊
01234567890␊
Out
1:13: Line must be at most 10 characters
2:13: Line must be at most 10 characters
3:12: Line must be at most 10 characters
4:12: Line must be at most 10 characters
not-ok.md

When configured with 80.

In
This line is simply not tooooooooooooooooooooooooooooooooooooooooooooooooooooooo
long.

Just like thiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiis one.

And this one is also very wrong: because the link starts aaaaaaafter the column: <http://line.com>

<http://this-long-url-with-a-long-domain-is-not-ok.co.uk/a-long-path?query=variables> and such.

And this one is also very wrong: because the code starts aaaaaaafter the column: `alpha.bravo()`

`alphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJuliettKiloLimaMikeNovemberOscar.papa()` and such.
Out
4:86: Line must be at most 80 characters
6:99: Line must be at most 80 characters
8:96: Line must be at most 80 characters
10:97: Line must be at most 80 characters
12:99: Line must be at most 80 characters
ok.md
In
This line is simply not toooooooooooooooooooooooooooooooooooooooooooo
long.

This is also fine: <http://this-long-url-with-a-long-domain.co.uk/a-long-path?query=variables>

<http://this-link-is-fine.com>

`alphaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJuliettKiloLimaMikeNovemberOscarPapaQuebec.romeo()`

[foo](http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables)

<http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables>

![foo](http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables)

| An | exception | is | line | length | in | long | tables | because | those | can’t | just |
| -- | --------- | -- | ---- | ------ | -- | ---- | ------ | ------- | ----- | ----- | ---- |
| be | helped    |    |      |        |    |      |        |         |       |       | .    |

<a><b><i><p><q><s><u>alpha bravo charlie delta echo foxtrot golf</u></s></q></p></i></b></a>

The following is also fine, because there is no whitespace.

<http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables>.

In addition, definitions are also fine:

[foo]: <http://this-long-url-with-a-long-domain-is-ok.co.uk/a-long-path?query=variables>
Out

No messages.

Install

npm:

npm install remark-lint-maximum-line-length

Use

You probably want to use it on the CLI through a config file:

 …
 "remarkConfig": {
   "plugins": [
     …
     "lint",
+    "lint-maximum-line-length",
     …
   ]
 }
 …

Or use it on the CLI directly

remark -u lint -u lint-maximum-line-length readme.md

Or use this on the API:

 var remark = require('remark')
 var report = require('vfile-reporter')

 remark()
   .use(require('remark-lint'))
+  .use(require('remark-lint-maximum-line-length'))
   .process('_Emphasis_ and **importance**', function (err, file) {
     console.error(report(err || file))
   })

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 02 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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