Socket
Socket
Sign inDemoInstall

remark-lint-no-heading-indent

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-lint-no-heading-indent - npm Package Compare versions

Comparing version 2.0.1 to 3.0.0

32

index.js

@@ -62,39 +62,19 @@ /**

function noHeadingIndent(tree, file) {
var contents = String(file)
var length = contents.length
visit(tree, 'heading', visitor)
function visitor(node) {
var initial
var begin
var index
var character
function visitor(node, _, parent) {
var diff
if (generated(node)) {
// Note: it’s rather complex to detect what the expected indent is in block
// quotes and lists, so let’s only do directly in root for now.
if (generated(node) || (parent && parent.type !== 'root')) {
return
}
initial = start(node)
begin = initial.offset
index = begin - 1
diff = start(node).column - 1
while (++index < length) {
character = contents.charAt(index)
if (character !== ' ' && character !== '\t') {
break
}
}
diff = index - begin
if (diff) {
file.message(
'Remove ' + diff + ' ' + plural('space', diff) + ' before this heading',
{
line: initial.line,
column: initial.column + diff
}
start(node)
)

@@ -101,0 +81,0 @@ }

2

package.json
{
"name": "remark-lint-no-heading-indent",
"version": "2.0.1",
"version": "3.0.0",
"description": "remark-lint rule to warn when headings are indented",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -159,5 +159,5 @@ <!--This file is generated-->

[chat-badge]: https://img.shields.io/badge/chat-spectrum.svg
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://spectrum.chat/unified/remark
[chat]: https://github.com/remarkjs/remark/discussions

@@ -164,0 +164,0 @@ [npm]: https://docs.npmjs.com/cli/install

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