diff --git a/packages/remark-lint-no-empty-url/index.js b/packages/remark-lint-no-empty-url/index.js index f07aada7..12c7c7b3 100644 --- a/packages/remark-lint-no-empty-url/index.js +++ b/packages/remark-lint-no-empty-url/index.js @@ -26,6 +26,10 @@ * * ![charlie](http://delta.com/echo.png "foxtrot"). * + * [zulu][yankee]. + * + * [yankee]: http://xray.com + * * @example * {"name": "not-ok.md", "label": "input"} * @@ -33,11 +37,16 @@ * * ![hotel](). * + * [zulu][yankee]. + * + * [yankee]: <> + * * @example * {"name": "not-ok.md", "label": "output"} * * 1:1-1:9: Don’t use links without URL * 3:1-3:11: Don’t use images without URL + * 7:1-7:13: Don’t use definitions without URL */ /** @@ -57,7 +66,9 @@ const remarkLintNoEmptyUrl = lintRule( (tree, file) => { visit(tree, (node) => { if ( - (node.type === 'link' || node.type === 'image') && + (node.type === 'link' || + node.type === 'image' || + node.type === 'definition') && !generated(node) && !node.url ) { diff --git a/packages/remark-lint-no-empty-url/readme.md b/packages/remark-lint-no-empty-url/readme.md index 12ea9934..6d368b9f 100644 --- a/packages/remark-lint-no-empty-url/readme.md +++ b/packages/remark-lint-no-empty-url/readme.md @@ -136,6 +136,10 @@ It’s recommended to fill them out. [alpha](http://bravo.com). ![charlie](http://delta.com/echo.png "foxtrot"). + +[zulu][yankee]. + +[yankee]: http://xray.com ``` ###### Out @@ -150,6 +154,10 @@ No messages. [golf](). ![hotel](). + +[zulu][yankee]. + +[yankee]: <> ``` ###### Out @@ -157,6 +165,7 @@ No messages. ```text 1:1-1:9: Don’t use links without URL 3:1-3:11: Don’t use images without URL +7:1-7:13: Don’t use definitions without URL ``` ## Compatibility