UNPKG

547 BJavaScriptView Raw
1'use strict'
2
3const pkg = require('../../package')
4
5const 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 */
15function getDocsUrl(ruleName) {
16 return `${REPO_URL}/tree/v${pkg.version}/docs/rules/${ruleName}.md`
17}
18
19module.exports = getDocsUrl