diff --git a/doc/rules.md b/doc/rules.md index dd531ada..d5afcc57 100644 --- a/doc/rules.md +++ b/doc/rules.md @@ -1171,6 +1171,8 @@ Options: `boolean`, default: `false`. Warn when the horizontal rules violate a given or detected style. + Note that horizontal rules are also called “thematic break”. + Options: `string`, either a valid markdown rule, or `consistent`, default: `'consistent'`. diff --git a/lib/rules/no-literal-urls.js b/lib/rules/no-literal-urls.js index 2ec32e96..8ed65a21 100644 --- a/lib/rules/no-literal-urls.js +++ b/lib/rules/no-literal-urls.js @@ -61,7 +61,7 @@ function noLiteralURLs(ast, file, preferred, done) { if ( initial === head && final === tail && - (value === node.href || value == MAILTO + node.href) + (value === node.url || value == MAILTO + node.url) ) { file.warn('Don’t use literal URLs without angle brackets', node); } diff --git a/lib/rules/no-missing-blank-lines.js b/lib/rules/no-missing-blank-lines.js index 75574bcb..73c5de4f 100644 --- a/lib/rules/no-missing-blank-lines.js +++ b/lib/rules/no-missing-blank-lines.js @@ -43,7 +43,7 @@ function isApplicable(node) { 'html', 'list', 'table', - 'horizontalRule' + 'thematicBreak' ].indexOf(node.type) !== -1; } diff --git a/lib/rules/rule-style.js b/lib/rules/rule-style.js index 15fa7d35..f6f55d13 100644 --- a/lib/rules/rule-style.js +++ b/lib/rules/rule-style.js @@ -6,6 +6,8 @@ * @fileoverview * Warn when the horizontal rules violate a given or detected style. * + * Note that horizontal rules are also called “thematic break”. + * * Options: `string`, either a valid markdown rule, or `consistent`, * default: `'consistent'`. * @example @@ -71,7 +73,7 @@ function ruleStyle(ast, file, preferred, done) { return; } - visit(ast, 'horizontalRule', function (node) { + visit(ast, 'thematicBreak', function (node) { var initial = start(node).offset; var final = end(node).offset; var hr; @@ -84,7 +86,7 @@ function ruleStyle(ast, file, preferred, done) { if (preferred) { if (hr !== preferred) { - file.warn('Horizontal rules should use `' + preferred + '`', node); + file.warn('Rules should use `' + preferred + '`', node); } } else { preferred = hr; diff --git a/package.json b/package.json index 6b13aecf..dade616e 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,10 @@ "istanbul": "^0.4.0", "jscs": "^2.0.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", "mocha": "^2.0.0", "vfile": "^1.0.0" diff --git a/script/build-rule-documentation.js b/script/build-rule-documentation.js index 30e5b256..cfcf475e 100755 --- a/script/build-rule-documentation.js +++ b/script/build-rule-documentation.js @@ -89,7 +89,7 @@ children.push( }, { 'type': 'link', - 'href': 'https://github.com/wooorm/remark-lint#list-of-external-rules', + 'url': 'https://github.com/wooorm/remark-lint#list-of-external-rules', 'children': [{ 'type': 'text', 'value': 'list of external rules' diff --git a/test/index.js b/test/index.js index c9df0b3d..573c2d43 100644 --- a/test/index.js +++ b/test/index.js @@ -1658,9 +1658,9 @@ describe('Rules', function () { describeSetting(true, function () { assertFile('rule-style-invalid.md', [ - 'rule-style-invalid.md:7:1-7:10: Horizontal rules should use `* * * *`', - 'rule-style-invalid.md:11:1-11:6: Horizontal rules should use `* * * *`', - 'rule-style-invalid.md:15:1-15:5: Horizontal rules should use `* * * *`' + 'rule-style-invalid.md:7:1-7:10: Rules should use `* * * *`', + 'rule-style-invalid.md:11:1-11:6: Rules should use `* * * *`', + 'rule-style-invalid.md:15:1-15:5: Rules should use `* * * *`' ]); assertFile('rule-style-valid.md', []);