remark-lint-maximum-line-length
Advanced tools
Comparing version 1.0.0 to 1.0.1
12
index.js
@@ -11,5 +11,11 @@ /** | ||
* | ||
* Ignores nodes which cannot be wrapped, such as heasings, tables, | ||
* code, link, images, and definitions. | ||
* Ignores nodes which cannot be wrapped, such as headings, tables, | ||
* code, and definitions. | ||
* | ||
* Ignores nodes which cannot be wrapped, such as headings, tables, | ||
* code, and definitions. | ||
* | ||
* URLs in images and links are okay if they occur at or after the wrap, | ||
* except when there’s white-space after them. | ||
* | ||
* @example {"name": "valid.md", "config": {"positionless": true}} | ||
@@ -99,4 +105,2 @@ * | ||
return; | ||
function ignore(node) { | ||
@@ -103,0 +107,0 @@ var applicable = isIgnored(node); |
{ | ||
"name": "remark-lint-maximum-line-length", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "remark-lint rule to warn when lines are too long", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -9,16 +9,27 @@ <!--This file is generated--> | ||
Ignores nodes which cannot be wrapped, such as heasings, tables, | ||
code, link, images, and definitions. | ||
Ignores nodes which cannot be wrapped, such as headings, tables, | ||
code, and definitions. | ||
## Install | ||
Ignores nodes which cannot be wrapped, such as headings, tables, | ||
code, and definitions. | ||
```sh | ||
npm install --save remark-lint-maximum-line-length | ||
``` | ||
URLs in images and links are okay if they occur at or after the wrap, | ||
except when there’s white-space after them. | ||
## Presets | ||
This rule is included in the following presets: | ||
| Preset | Setting | | ||
| ------ | ------- | | ||
| [`remark-preset-lint-markdown-style-guide`](https://github.com/wooorm/remark-lint/tree/master/packages/remark-preset-lint-markdown-style-guide) | | | ||
## Example | ||
When this rule is `80`, the following file | ||
`invalid.md` is **not** ok: | ||
##### `invalid.md` | ||
When configured with `80`. | ||
###### In | ||
```markdown | ||
@@ -35,2 +46,4 @@ This line is simply not tooooooooooooooooooooooooooooooooooooooooooooooooooooooo | ||
###### Out | ||
```text | ||
@@ -42,5 +55,6 @@ 4:86: Line must be at most 80 characters | ||
When this rule is turned on, the following file | ||
`valid.md` is ok: | ||
##### `valid.md` | ||
###### In | ||
```markdown | ||
@@ -73,4 +87,51 @@ This line is simply not toooooooooooooooooooooooooooooooooooooooooooo | ||
###### Out | ||
No messages. | ||
## Install | ||
```sh | ||
npm install remark-lint-maximum-line-length | ||
``` | ||
## Usage | ||
You probably want to use it on the CLI through a config file: | ||
```diff | ||
... | ||
"remarkConfig": { | ||
"plugins": [ | ||
... | ||
"lint", | ||
+ "lint-maximum-line-length", | ||
... | ||
] | ||
} | ||
... | ||
``` | ||
Or use it on the CLI directly | ||
```sh | ||
remark -u lint -u lint-maximum-line-length 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-maximum-line-length')) | ||
.process('_Emphasis_ and **importance**', function (err, file) { | ||
console.error(report(err || file)); | ||
}); | ||
``` | ||
## License | ||
[MIT](https://github.com/wooorm/remark-lint/blob/master/LICENSE) © [Titus Wormer](http://wooorm.com) |
9176
148
134