Skip to content

Commit ee8af5f

Browse files
authored
docs: Link to unit tests from rule documentation (#15207)
In the Resources section at the bottom of each rule's documentation, we already link to the rule's implementation and the documentation's Markdown source. This adds a link to the rule's unit tests.
1 parent 1c0ca3c commit ee8af5f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Makefile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ target.gensite = function(prereleaseVersion) {
648648
if (test("-f", filename) && path.extname(filename) === ".md") {
649649

650650
const rulesUrl = "https://github.com/eslint/eslint/tree/HEAD/lib/rules/",
651+
testsUrl = "https://github.com/eslint/eslint/tree/HEAD/tests/lib/rules/",
651652
docsUrl = "https://github.com/eslint/eslint/tree/HEAD/docs/rules/",
652653
baseName = path.basename(filename),
653654
sourceBaseName = `${path.basename(filename, ".md")}.js`,
@@ -731,6 +732,7 @@ target.gensite = function(prereleaseVersion) {
731732
text += "\n## Resources\n\n";
732733
if (!removed) {
733734
text += `* [Rule source](${rulesUrl}${sourceBaseName})\n`;
735+
text += `* [Test source](${testsUrl}${sourceBaseName})\n`;
734736
}
735737
text += `* [Documentation source](${docsUrl}${baseName})\n`;
736738
}

0 commit comments

Comments
 (0)