get-documentation-url.js 336 B

12345678910
  1. 'use strict';
  2. const path = require('node:path');
  3. const packageJson = require('../../package.json');
  4. const repoUrl = 'https://github.com/sindresorhus/eslint-plugin-unicorn';
  5. module.exports = filename => {
  6. const ruleName = path.basename(filename, '.js');
  7. return `${repoUrl}/blob/v${packageJson.version}/docs/rules/${ruleName}.md`;
  8. };