remark-lint-no-shell-dollars
Advanced tools
Comparing version 2.0.0 to 2.0.1
19
index.js
@@ -13,2 +13,6 @@ /** | ||
* | ||
* ```bash | ||
* echo a | ||
* ``` | ||
* | ||
* ```sh | ||
@@ -38,2 +42,6 @@ * echo a | ||
* | ||
* ```sh | ||
* $ echo a | ||
* ``` | ||
* | ||
* ```bash | ||
@@ -46,3 +54,4 @@ * $ echo a | ||
* | ||
* 1:1-4:4: Do not use dollar signs before shell commands | ||
* 1:1-3:4: Do not use dollar signs before shell commands | ||
* 5:1-8:4: Do not use dollar signs before shell commands | ||
*/ | ||
@@ -87,7 +96,7 @@ | ||
if (!generated(node) && node.lang && flags.indexOf(node.lang) !== -1) { | ||
lines = node.value.split('\n') | ||
lines = node.value.split('\n').filter(notEmpty) | ||
length = lines.length | ||
index = -1 | ||
if (length <= 1) { | ||
if (length === 0) { | ||
return | ||
@@ -107,2 +116,6 @@ } | ||
} | ||
function notEmpty(line) { | ||
return line.trim().length !== 0 | ||
} | ||
} |
{ | ||
"name": "remark-lint-no-shell-dollars", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "remark-lint rule to warn when shell code is prefixed by dollars", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -32,2 +32,6 @@ <!--This file is generated--> | ||
````markdown | ||
```bash | ||
echo a | ||
``` | ||
```sh | ||
@@ -65,2 +69,6 @@ echo a | ||
````markdown | ||
```sh | ||
$ echo a | ||
``` | ||
```bash | ||
@@ -75,3 +83,4 @@ $ echo a | ||
```text | ||
1:1-4:4: Do not use dollar signs before shell commands | ||
1:1-3:4: Do not use dollar signs before shell commands | ||
5:1-8:4: Do not use dollar signs before shell commands | ||
``` | ||
@@ -78,0 +87,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6706
103
183