remark-lint-heading-increment
Advanced tools
Comparing version 1.0.3 to 1.0.4
12
index.js
@@ -9,3 +9,3 @@ /** | ||
* | ||
* @example {"name": "valid.md"} | ||
* @example {"name": "ok.md"} | ||
* | ||
@@ -16,3 +16,3 @@ * # Alpha | ||
* | ||
* @example {"name": "invalid.md", "label": "input"} | ||
* @example {"name": "not-ok.md", "label": "input"} | ||
* | ||
@@ -23,3 +23,3 @@ * # Charlie | ||
* | ||
* @example {"name": "invalid.md", "label": "output"} | ||
* @example {"name": "not-ok.md", "label": "output"} | ||
* | ||
@@ -40,3 +40,3 @@ * 3:1-3:10: Heading levels should increment by one level at a time | ||
function headingIncrement(tree, file) { | ||
var prev = null | ||
var previous = null | ||
@@ -51,9 +51,9 @@ visit(tree, 'heading', visitor) | ||
if (prev && depth > prev + 1) { | ||
if (previous && depth > previous + 1) { | ||
file.message(reason, node) | ||
} | ||
prev = depth | ||
previous = depth | ||
} | ||
} | ||
} |
{ | ||
"name": "remark-lint-heading-increment", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "remark-lint rule to warn when headings increment with more than 1 level at a time", | ||
@@ -10,2 +10,3 @@ "license": "MIT", | ||
"rule", | ||
"remark-lint-rule", | ||
"heading", | ||
@@ -17,2 +18,6 @@ "increment", | ||
"bugs": "https://github.com/remarkjs/remark-lint/issues", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/unified" | ||
}, | ||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)", | ||
@@ -19,0 +24,0 @@ "contributors": [ |
@@ -25,3 +25,3 @@ <!--This file is generated--> | ||
##### `valid.md` | ||
##### `ok.md` | ||
@@ -40,3 +40,3 @@ ###### In | ||
##### `invalid.md` | ||
##### `not-ok.md` | ||
@@ -70,12 +70,12 @@ ###### In | ||
```diff | ||
... | ||
… | ||
"remarkConfig": { | ||
"plugins": [ | ||
... | ||
… | ||
"lint", | ||
+ "lint-heading-increment", | ||
... | ||
… | ||
] | ||
} | ||
... | ||
… | ||
``` | ||
@@ -92,4 +92,4 @@ | ||
```diff | ||
var remark = require('remark'); | ||
var report = require('vfile-reporter'); | ||
var remark = require('remark') | ||
var report = require('vfile-reporter') | ||
@@ -100,4 +100,4 @@ remark() | ||
.process('_Emphasis_ and **importance**', function (err, file) { | ||
console.error(report(err || file)); | ||
}); | ||
console.error(report(err || file)) | ||
}) | ||
``` | ||
@@ -111,4 +111,4 @@ | ||
This project has a [Code of Conduct][coc]. | ||
By interacting with this repository, organisation, or community you agree to | ||
This project has a [code of conduct][coc]. | ||
By interacting with this repository, organization, or community you agree to | ||
abide by its terms. | ||
@@ -142,3 +142,3 @@ | ||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg | ||
[chat-badge]: https://img.shields.io/badge/chat-spectrum.svg | ||
@@ -145,0 +145,0 @@ [chat]: https://spectrum.chat/unified/remark |
5270