remark-lint
Advanced tools
Comparing version 2.3.1 to 3.0.0
@@ -5,2 +5,9 @@ <!--remark setext--> | ||
3.0.0 / 2016-02-14 | ||
================== | ||
* Remove support for Duo ([`e55fb3a`](https://github.com/wooorm/remark-lint/commit/e55fb3a)) | ||
* Update for changes in remark@4.0.0 ([`7fde792`](https://github.com/wooorm/remark-lint/commit/7fde792)) | ||
* Add example for running remark with lint plugin ([`34d19b4`](https://github.com/wooorm/remark-lint/commit/34d19b4)) | ||
2.3.1 / 2016-02-03 | ||
@@ -7,0 +14,0 @@ ================== |
@@ -26,3 +26,2 @@ /** | ||
var sort = require('vfile-sort'); | ||
var range = require('remark-range'); | ||
var control = require('remark-message-control'); | ||
@@ -261,8 +260,2 @@ var internals = require('./rules'); | ||
/* | ||
* Ensure offset information is added. | ||
*/ | ||
remark.use(range); | ||
/* | ||
* Add each rule as a seperate plugin. | ||
@@ -269,0 +262,0 @@ */ |
@@ -17,4 +17,4 @@ /** | ||
* { | ||
* "checked": 'x', | ||
* "unchecked": ' ' | ||
* "checked": "x", | ||
* "unchecked": " " | ||
* } | ||
@@ -56,2 +56,3 @@ * ``` | ||
var vfileLocation = require('vfile-location'); | ||
var visit = require('unist-util-visit'); | ||
@@ -90,2 +91,3 @@ var position = require('mdast-util-position'); | ||
var contents = file.toString(); | ||
var location = vfileLocation(file); | ||
@@ -175,4 +177,4 @@ if (preferred === 'consistent' || typeof preferred !== 'object') { | ||
{ | ||
'start': file.offsetToPosition(stop - 1), | ||
'end': file.offsetToPosition(stop) | ||
'start': location.toPosition(stop - 1), | ||
'end': location.toPosition(stop) | ||
} | ||
@@ -179,0 +181,0 @@ ); |
@@ -30,2 +30,3 @@ /** | ||
var vfileLocation = require('vfile-location'); | ||
var visit = require('unist-util-visit'); | ||
@@ -51,2 +52,3 @@ var position = require('mdast-util-position'); | ||
var contents = file.toString(); | ||
var location = vfileLocation(file); | ||
@@ -90,4 +92,4 @@ visit(ast, 'listItem', function (node) { | ||
file.warn('Checkboxes should be followed by a single character', { | ||
'start': file.offsetToPosition(final - value.length + 1), | ||
'end': file.offsetToPosition(final) | ||
'start': location.toPosition(final - value.length + 1), | ||
'end': location.toPosition(final) | ||
}); | ||
@@ -94,0 +96,0 @@ }); |
@@ -42,2 +42,3 @@ /** | ||
var vfileLocation = require('vfile-location'); | ||
var visit = require('unist-util-visit'); | ||
@@ -74,2 +75,3 @@ var position = require('mdast-util-position'); | ||
var contents = file.toString(); | ||
var location = vfileLocation(file); | ||
@@ -128,3 +130,3 @@ preferred = typeof preferred !== 'string' || preferred === 'consistent' ? null : preferred; | ||
} else if (preferred !== character) { | ||
pos = file.offsetToPosition(last + 1); | ||
pos = location.toPosition(last + 1); | ||
file.warn('Titles should use `' + (preferred === ')' ? '()' : preferred) + '` as a quote', pos); | ||
@@ -131,0 +133,0 @@ } |
@@ -28,2 +28,3 @@ /** | ||
var vfileLocation = require('vfile-location'); | ||
var visit = require('unist-util-visit'); | ||
@@ -43,2 +44,3 @@ var position = require('mdast-util-position'); | ||
var contents = file.toString(); | ||
var location = vfileLocation(file); | ||
var last = contents.length; | ||
@@ -57,3 +59,3 @@ | ||
var line = start + n + 1; | ||
var offset = file.positionToOffset({ | ||
var offset = location.toOffset({ | ||
'line': line, | ||
@@ -60,0 +62,0 @@ 'column': column |
@@ -64,3 +64,3 @@ /** | ||
final === tail && | ||
(value === node.href || value == MAILTO + node.href) | ||
(value === node.url || value == MAILTO + node.url) | ||
) { | ||
@@ -67,0 +67,0 @@ file.warn('Don’t use literal URLs without angle brackets', node); |
@@ -46,3 +46,3 @@ /** | ||
'table', | ||
'horizontalRule' | ||
'thematicBreak' | ||
].indexOf(node.type) !== -1; | ||
@@ -49,0 +49,0 @@ } |
@@ -25,2 +25,8 @@ /** | ||
/* | ||
* Dependencies. | ||
*/ | ||
var vfileLocation = require('vfile-location'); | ||
/** | ||
@@ -36,2 +42,3 @@ * Warn when hard-tabs instead of spaces are used. | ||
var content = file.toString(); | ||
var location = vfileLocation(file); | ||
var index = -1; | ||
@@ -42,3 +49,3 @@ var length = content.length; | ||
if (content.charAt(index) === '\t') { | ||
file.warn('Use spaces instead of hard-tabs', file.offsetToPosition(index)); | ||
file.warn('Use spaces instead of hard-tabs', location.toPosition(index)); | ||
} | ||
@@ -45,0 +52,0 @@ } |
@@ -9,2 +9,4 @@ /** | ||
* | ||
* Note that horizontal rules are also called “thematic break”. | ||
* | ||
* Options: `string`, either a valid markdown rule, or `consistent`, | ||
@@ -75,3 +77,3 @@ * default: `'consistent'`. | ||
visit(ast, 'horizontalRule', function (node) { | ||
visit(ast, 'thematicBreak', function (node) { | ||
var initial = start(node).offset; | ||
@@ -89,3 +91,3 @@ var final = end(node).offset; | ||
if (hr !== preferred) { | ||
file.warn('Horizontal rules should use `' + preferred + '`', node); | ||
file.warn('Rules should use `' + preferred + '`', node); | ||
} | ||
@@ -92,0 +94,0 @@ } else { |
{ | ||
"name": "remark-lint", | ||
"version": "2.3.1", | ||
"version": "3.0.0", | ||
"description": "Lint markdown with remark", | ||
@@ -17,3 +17,6 @@ "license": "MIT", | ||
"bugs": "https://github.com/wooorm/remark-lint/issues", | ||
"author": "Titus Wormer <tituswormer@gmail.com>", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"contributors": [ | ||
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)" | ||
], | ||
"dependencies": { | ||
@@ -27,4 +30,4 @@ "decamelize": "^1.0.0", | ||
"remark-message-control": "^1.0.1", | ||
"remark-range": "^2.0.0", | ||
"unist-util-visit": "^1.0.0", | ||
"vfile-location": "^2.0.0", | ||
"vfile-sort": "^1.0.0" | ||
@@ -39,3 +42,3 @@ }, | ||
"dox": "^0.8.0", | ||
"eslint": "^1.0.0", | ||
"eslint": "^2.0.0", | ||
"esmangle": "^1.0.0", | ||
@@ -45,6 +48,6 @@ "istanbul": "^0.4.0", | ||
"jscs-jsdoc": "^1.0.0", | ||
"remark": "^3.0.0", | ||
"remark-comment-config": "^2.0.0", | ||
"remark-github": "^4.0.0", | ||
"remark-toc": "^2.0.0", | ||
"remark": "^4.0.0-alpha.4", | ||
"remark-comment-config": "^3.0.0", | ||
"remark-github": "^4.0.1", | ||
"remark-toc": "^3.0.0", | ||
"remark-validate-links": "^2.0.0", | ||
@@ -51,0 +54,0 @@ "mocha": "^2.0.0", |
@@ -38,5 +38,4 @@ # ![remark-lint][logo] | ||
**remark-lint** is also available for [duo][duo-install], | ||
and as an AMD, CommonJS, and globals module, [uncompressed and | ||
compressed][releases]. | ||
**remark-lint** is also available as an AMD, CommonJS, and globals | ||
module, [uncompressed and compressed][releases]. | ||
@@ -100,6 +99,5 @@ ## Command line | ||
"lint": { | ||
"no-multiple-toplevel-headings": false, | ||
"maximum-line-length": 79, | ||
"emphasis-marker": "_", | ||
"strong-marker": "*" | ||
"no-multiple-toplevel-headings": false, | ||
"list-item-indent": false, | ||
"maximum-line-length": 79 | ||
} | ||
@@ -113,7 +111,29 @@ }, | ||
Where the object at `plugins.lint` is a map of `ruleId`s and their values. | ||
The object at `settings` determines how **remark** parses (and compiles) | ||
markdown code. Read more about the latter on [**remark**’s | ||
readme][remark-process]. | ||
Where the object at `plugins.lint` is a map of `ruleId`s and their values. The | ||
object at `settings` determines how **remark** parses (and compiles) | ||
markdown code. Read more about the latter on | ||
[**remark**’s readme][remark-process]. | ||
Using our `example.md` from before: | ||
```md | ||
* Hello | ||
[World][] | ||
``` | ||
We now run the below command _without_ the `-u remark-lint` since | ||
our `.remarkrc` includes the lint plugin. | ||
```bash | ||
remark example.md | ||
# | ||
# Yields: | ||
# | ||
# example.md | ||
# 3:1-3:10 warning Found reference to undefined definition no-undefined-references | ||
# | ||
# ⚠ 2 warnings | ||
``` | ||
In addition, you can also provide configuration comments to turn a rule | ||
@@ -217,4 +237,2 @@ on or off inside a file. Note that you cannot change what a setting, | ||
[duo-install]: http://duojs.org/#getting-started | ||
[releases]: https://github.com/wooorm/remark-lint/releases | ||
@@ -221,0 +239,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
141898
4663
259
+ Addedvfile-location@^2.0.0
+ Addedvfile-location@2.0.6(transitive)
- Removedremark-range@^2.0.0