1 |
|
2 |
|
3 | const pkg = require('../../package')
|
4 |
|
5 | const REPO_URL = 'https://github.com/xjamundx/eslint-plugin-promise'
|
6 |
|
7 | /**
|
8 | * Generates the URL to documentation for the given rule name. It uses the
|
9 | * package version to build the link to a tagged version of the
|
10 | * documentation file.
|
11 | *
|
12 | * @param {string} ruleName - Name of the eslint rule
|
13 | * @returns {string} URL to the documentation for the given rule
|
14 | */
|
15 | function getDocsUrl(ruleName) {
|
16 | return `${REPO_URL}/tree/v${pkg.version}/docs/rules/${ruleName}.md`
|
17 | }
|
18 |
|
19 | module.exports = getDocsUrl
|