Skip to content

Commit 839f40e

Browse files
committed
Add url.js from eslint-plugin-github
1 parent cbaab90 commit 839f40e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/rules/a11y-explicit-heading.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ const isInvalid = elem => {
2727

2828
module.exports = {
2929
meta: {
30+
docs: {
31+
description: 'Heading component must have explicit heading level, and specific `as` usage.',
32+
url: require('../url')(module),
33+
},
3034
schema: [
3135
{
3236
properties: {

src/url.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const {homepage, version} = require('../package.json')
2+
const path = require('path')
3+
4+
module.exports = ({id}) => {
5+
const url = new URL(homepage)
6+
const rule = path.basename(id, '.js')
7+
url.hash = ''
8+
url.pathname += `/blob/v${version}/docs/rules/${rule}.md`
9+
return url.toString()
10+
}

0 commit comments

Comments
 (0)