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

remark-lint-no-consecutive-blank-lines

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-lint-no-consecutive-blank-lines - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

28

index.js

@@ -20,9 +20,9 @@ /**

*
* @example {"name": "valid.md"}
* @example {"name": "ok.md"}
*
* Foo...
* Foo…
* ␊
* ...Bar.
* …Bar.
*
* @example {"name": "valid-for-code.md"}
* @example {"name": "ok-for-code.md"}
*

@@ -38,15 +38,15 @@ * Paragraph.

*
* @example {"name": "invalid.md", "label": "input"}
* @example {"name": "not-ok.md", "label": "input"}
*
* Foo...
* Foo…
* ␊
* ␊
* ...Bar
* …Bar
* ␊
* ␊
*
* @example {"name": "invalid.md", "label": "output"}
* @example {"name": "not-ok.md", "label": "output"}
*
* 4:1: Remove 1 line before node
* 4:7: Remove 2 lines after node
* 4:5: Remove 2 lines after node
*/

@@ -117,9 +117,9 @@

function visitChild(child, index, all) {
var prev = all[index - 1]
var previous = all[index - 1]
var max = 2
if (prev && !generated(prev) && !generated(child)) {
if (previous && !generated(previous) && !generated(child)) {
if (
(prev.type === 'list' && child.type === 'list') ||
(child.type === 'code' && prev.type === 'list' && !child.lang)
(previous.type === 'list' && child.type === 'list') ||
(child.type === 'code' && previous.type === 'list' && !child.lang)
) {

@@ -129,5 +129,5 @@ max++

compare(position.end(prev), position.start(child), max)
compare(position.end(previous), position.start(child), max)
}
}
}
{
"name": "remark-lint-no-consecutive-blank-lines",
"version": "1.0.3",
"version": "1.0.4",
"description": "remark-lint rule to warn for too many consecutive blank lines",

@@ -10,2 +10,3 @@ "license": "MIT",

"rule",
"remark-lint-rule",
"blank",

@@ -16,2 +17,6 @@ "lines"

"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)",

@@ -18,0 +23,0 @@ "contributors": [

@@ -36,3 +36,3 @@ <!--This file is generated-->

##### `valid.md`
##### `ok.md`

@@ -44,5 +44,5 @@ ###### In

```markdown
Foo...
Foo…
...Bar.
…Bar.
```

@@ -54,3 +54,3 @@

##### `valid-for-code.md`
##### `ok-for-code.md`

@@ -80,3 +80,3 @@ ###### In

##### `invalid.md`
##### `not-ok.md`

@@ -88,6 +88,6 @@ ###### In

```markdown
Foo...
Foo…
...Bar
…Bar

@@ -101,3 +101,3 @@

4:1: Remove 1 line before node
4:7: Remove 2 lines after node
4:5: Remove 2 lines after node
```

@@ -118,12 +118,12 @@

```diff
...
"remarkConfig": {
"plugins": [
...
"lint",
+ "lint-no-consecutive-blank-lines",
...
]
}
...
```

@@ -140,4 +140,4 @@

```diff
var remark = require('remark');
var report = require('vfile-reporter');
var remark = require('remark')
var report = require('vfile-reporter')

@@ -148,4 +148,4 @@ remark()

.process('_Emphasis_ and **importance**', function (err, file) {
console.error(report(err || file));
});
console.error(report(err || file))
})
```

@@ -159,4 +159,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.

@@ -190,3 +190,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

@@ -193,0 +193,0 @@ [chat]: https://spectrum.chat/unified/remark

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