remark-lint-ordered-list-marker-style
Advanced tools
Comparing version 1.0.3 to 1.0.4
34
index.js
@@ -16,3 +16,3 @@ /** | ||
* | ||
* @example {"name": "valid.md"} | ||
* @example {"name": "ok.md"} | ||
* | ||
@@ -28,3 +28,3 @@ * 1. Foo | ||
* | ||
* @example {"name": "valid.md", "setting": "."} | ||
* @example {"name": "ok.md", "setting": "."} | ||
* | ||
@@ -35,3 +35,3 @@ * 1. Foo | ||
* | ||
* @example {"name": "valid.md", "setting": ")", "config": {"commonmark": true}} | ||
* @example {"name": "ok.md", "setting": ")", "config": {"commonmark": true}} | ||
* | ||
@@ -44,3 +44,3 @@ * <!-- This requires commonmark. --> | ||
* | ||
* @example {"name": "invalid.md", "label": "input", "config": {"commonmark": true}} | ||
* @example {"name": "not-ok.md", "label": "input", "config": {"commonmark": true}} | ||
* | ||
@@ -51,9 +51,9 @@ * 1. Foo | ||
* | ||
* @example {"name": "invalid.md", "label": "output"} | ||
* @example {"name": "not-ok.md", "label": "output"} | ||
* | ||
* 3:1-3:8: Marker style should be `.` | ||
* | ||
* @example {"name": "invalid.md", "label": "output", "setting": "!", "config": {"positionless": true}} | ||
* @example {"name": "not-ok.md", "label": "output", "setting": "💩", "config": {"positionless": true}} | ||
* | ||
* 1:1: Invalid ordered list-item marker style `!`: use either `'.'` or `')'` | ||
* 1:1: Incorrect ordered list item marker style `💩`: use either `'.'` or `')'` | ||
*/ | ||
@@ -81,11 +81,11 @@ | ||
function orderedListMarkerStyle(tree, file, pref) { | ||
function orderedListMarkerStyle(tree, file, option) { | ||
var contents = String(file) | ||
var preferred = | ||
typeof option !== 'string' || option === 'consistent' ? null : option | ||
pref = typeof pref !== 'string' || pref === 'consistent' ? null : pref | ||
if (styles[pref] !== true) { | ||
if (styles[preferred] !== true) { | ||
file.fail( | ||
'Invalid ordered list-item marker style `' + | ||
pref + | ||
'Incorrect ordered list item marker style `' + | ||
preferred + | ||
"`: use either `'.'` or `')'`" | ||
@@ -113,8 +113,8 @@ ) | ||
if (pref) { | ||
if (marker !== pref) { | ||
file.message('Marker style should be `' + pref + '`', child) | ||
if (preferred) { | ||
if (marker !== preferred) { | ||
file.message('Marker style should be `' + preferred + '`', child) | ||
} | ||
} else { | ||
pref = marker | ||
preferred = marker | ||
} | ||
@@ -121,0 +121,0 @@ } |
{ | ||
"name": "remark-lint-ordered-list-marker-style", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "remark-lint rule to warn when the markers of ordered lists violate a given style", | ||
@@ -10,2 +10,3 @@ "license": "MIT", | ||
"rule", | ||
"remark-lint-rule", | ||
"ordered", | ||
@@ -17,2 +18,6 @@ "list", | ||
"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": [ |
@@ -34,3 +34,3 @@ <!--This file is generated--> | ||
##### `valid.md` | ||
##### `ok.md` | ||
@@ -54,3 +54,3 @@ ###### In | ||
##### `invalid.md` | ||
##### `not-ok.md` | ||
@@ -71,3 +71,3 @@ ###### In | ||
##### `valid.md` | ||
##### `ok.md` | ||
@@ -88,3 +88,3 @@ When configured with `'.'`. | ||
##### `valid.md` | ||
##### `ok.md` | ||
@@ -107,5 +107,5 @@ When configured with `')'`. | ||
##### `invalid.md` | ||
##### `not-ok.md` | ||
When configured with `'!'`. | ||
When configured with `'💩'`. | ||
@@ -115,3 +115,3 @@ ###### Out | ||
```text | ||
1:1: Invalid ordered list-item marker style `!`: use either `'.'` or `')'` | ||
1:1: Incorrect ordered list item marker style `💩`: use either `'.'` or `')'` | ||
``` | ||
@@ -132,12 +132,12 @@ | ||
```diff | ||
... | ||
… | ||
"remarkConfig": { | ||
"plugins": [ | ||
... | ||
… | ||
"lint", | ||
+ "lint-ordered-list-marker-style", | ||
... | ||
… | ||
] | ||
} | ||
... | ||
… | ||
``` | ||
@@ -154,4 +154,4 @@ | ||
```diff | ||
var remark = require('remark'); | ||
var report = require('vfile-reporter'); | ||
var remark = require('remark') | ||
var report = require('vfile-reporter') | ||
@@ -162,4 +162,4 @@ remark() | ||
.process('_Emphasis_ and **importance**', function (err, file) { | ||
console.error(report(err || file)); | ||
}); | ||
console.error(report(err || file)) | ||
}) | ||
``` | ||
@@ -173,4 +173,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. | ||
@@ -204,3 +204,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 | ||
@@ -207,0 +207,0 @@ [chat]: https://spectrum.chat/unified/remark |
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
7919
105