remark-lint/packages/remark-lint-no-empty-url
2019-01-12 11:26:02 +01:00
..
index.js Refactor code-style 2018-05-19 13:51:23 +02:00
package.json remark-lint-no-empty-url: 1.0.4 2019-01-12 11:26:02 +01:00
readme.md Move URLs to HTTPS 2018-11-22 12:19:09 +01:00

remark-lint-no-empty-url

Warn for empty URLs in links and images.

Presets

This rule is not included in any default preset

Example

valid.md
In
[alpha](http://bravo.com).

![charlie](http://delta.com/echo.png "foxtrott").
Out

No messages.

invalid.md
In
[golf]().

![hotel]().
Out
1:1-1:9: Dont use links without URL
3:1-3:11: Dont use images without URL

Install

npm install remark-lint-no-empty-url

Usage

You probably want to use it on the CLI through a config file:

 ...
 "remarkConfig": {
   "plugins": [
     ...
     "lint",
+    "lint-no-empty-url",
     ...
   ]
 }
 ...

Or use it on the CLI directly

remark -u lint -u lint-no-empty-url readme.md

Or use this on the API:

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

 remark()
   .use(require('remark-lint'))
+  .use(require('remark-lint-no-empty-url'))
   .process('_Emphasis_ and **importance**', function (err, file) {
     console.error(report(err || file));
   });

License

MIT © Titus Wormer