Skip to content

Commit cf0939b

Browse files
committed
Use link to tagged version for rule docs
1 parent aa3daae commit cf0939b

File tree

3 files changed

+94
-92
lines changed

3 files changed

+94
-92
lines changed

package.json

Lines changed: 89 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
11
{
2-
"name": "eslint-plugin-ava",
3-
"version": "4.4.0",
4-
"description": "ESLint rules for AVA",
5-
"license": "MIT",
6-
"repository": "avajs/eslint-plugin-ava",
7-
"author": {
8-
"name": "Sindre Sorhus",
9-
"email": "[email protected]",
10-
"url": "sindresorhus.com"
11-
},
12-
"maintainers": [
13-
{
14-
"name": "Vadim Demedes",
15-
"email": "[email protected]",
16-
"url": "github.com/vdemedes"
17-
},
18-
{
19-
"name": "James Talmage",
20-
"email": "[email protected]",
21-
"url": "github.com/jamestalmage"
22-
},
23-
{
24-
"name": "Mark Wubben",
25-
"email": "[email protected]",
26-
"url": "novemberborn.net"
27-
},
28-
{
29-
"name": "Takuto Wada",
30-
"email": "[email protected]",
31-
"url": "github.com/twada"
32-
},
33-
{
34-
"name": "Jeroen Engels",
35-
"email": "[email protected]",
36-
"url": "github.com/jfmengels"
37-
}
38-
],
39-
"engines": {
40-
"node": ">=4"
41-
},
42-
"scripts": {
43-
"test": "xo && nyc ava",
44-
"coveralls": "nyc report --reporter=text-lcov | coveralls"
45-
},
46-
"files": [
47-
"index.js",
48-
"create-ava-rule.js",
49-
"util.js",
50-
"rules"
51-
],
52-
"keywords": [
53-
"eslint",
54-
"eslintplugin",
55-
"eslint-plugin",
56-
"ava",
57-
"test",
58-
"runner",
59-
"assert",
60-
"asserts",
61-
"assertion",
62-
"mocha"
63-
],
64-
"dependencies": {
65-
"arrify": "^1.0.1",
66-
"deep-strict-equal": "^0.2.0",
67-
"enhance-visitors": "^1.0.0",
68-
"espree": "^3.1.3",
69-
"espurify": "^1.5.0",
70-
"import-modules": "^1.1.0",
71-
"multimatch": "^2.1.0",
72-
"pkg-up": "^2.0.0"
73-
},
74-
"devDependencies": {
75-
"ava": "*",
76-
"babel-eslint": "^8.0.2",
77-
"coveralls": "^3.0.0",
78-
"eslint": "^4.5.0",
79-
"eslint-ava-rule-tester": "^2.0.0",
80-
"js-combinatorics": "^0.5.0",
81-
"nyc": "^11.1.0",
82-
"pify": "^3.0.0",
83-
"xo": "*"
84-
},
85-
"peerDependencies": {
86-
"eslint": ">=3.6"
87-
},
88-
"ava": {
89-
"failWithoutAssertions": true
90-
}
2+
"name": "eslint-plugin-ava",
3+
"version": "4.4.0",
4+
"description": "ESLint rules for AVA",
5+
"license": "MIT",
6+
"repository": "avajs/eslint-plugin-ava",
7+
"author": {
8+
"name": "Sindre Sorhus",
9+
"email": "[email protected]",
10+
"url": "sindresorhus.com"
11+
},
12+
"maintainers": [
13+
{
14+
"name": "Vadim Demedes",
15+
"email": "[email protected]",
16+
"url": "github.com/vdemedes"
17+
},
18+
{
19+
"name": "James Talmage",
20+
"email": "[email protected]",
21+
"url": "github.com/jamestalmage"
22+
},
23+
{
24+
"name": "Mark Wubben",
25+
"email": "[email protected]",
26+
"url": "novemberborn.net"
27+
},
28+
{
29+
"name": "Takuto Wada",
30+
"email": "[email protected]",
31+
"url": "github.com/twada"
32+
},
33+
{
34+
"name": "Jeroen Engels",
35+
"email": "[email protected]",
36+
"url": "github.com/jfmengels"
37+
}
38+
],
39+
"engines": {
40+
"node": ">=4"
41+
},
42+
"scripts": {
43+
"test": "xo && nyc ava",
44+
"coveralls": "nyc report --reporter=text-lcov | coveralls"
45+
},
46+
"files": [
47+
"index.js",
48+
"create-ava-rule.js",
49+
"util.js",
50+
"rules"
51+
],
52+
"keywords": [
53+
"eslint",
54+
"eslintplugin",
55+
"eslint-plugin",
56+
"ava",
57+
"test",
58+
"runner",
59+
"assert",
60+
"asserts",
61+
"assertion",
62+
"mocha"
63+
],
64+
"dependencies": {
65+
"arrify": "^1.0.1",
66+
"deep-strict-equal": "^0.2.0",
67+
"enhance-visitors": "^1.0.0",
68+
"espree": "^3.1.3",
69+
"espurify": "^1.5.0",
70+
"import-modules": "^1.1.0",
71+
"multimatch": "^2.1.0",
72+
"pkg-up": "^2.0.0"
73+
},
74+
"devDependencies": {
75+
"ava": "*",
76+
"babel-eslint": "^8.0.2",
77+
"coveralls": "^3.0.0",
78+
"eslint": "^4.5.0",
79+
"eslint-ava-rule-tester": "^2.0.0",
80+
"js-combinatorics": "^0.5.0",
81+
"nyc": "^11.1.0",
82+
"pify": "^3.0.0",
83+
"xo": "*"
84+
},
85+
"peerDependencies": {
86+
"eslint": ">=3.6"
87+
},
88+
"ava": {
89+
"failWithoutAssertions": true
90+
}
9191
}

test/util.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import test from 'ava';
22
import util from '../util';
3+
import pkg from '../package';
34

45
test('returns the URL of the a named rule\'s documentation', t => {
5-
const url = 'https://github.com/avajs/eslint-plugin-ava/blob/master/docs/rules/foo.md';
6+
const url = `https://github.com/avajs/eslint-plugin-ava/blob/v${pkg.version}/docs/rules/foo.md`;
67
t.is(util.getDocsUrl('foo'), url);
78
});
89

@@ -12,6 +13,6 @@ test('returns the URL of the a named rule\'s documentation at a commit hash', t
1213
});
1314

1415
test('determines the rule name from the file', t => {
15-
const url = 'https://github.com/avajs/eslint-plugin-ava/blob/master/docs/rules/util.md';
16+
const url = `https://github.com/avajs/eslint-plugin-ava/blob/v${pkg.version}/docs/rules/util.md`;
1617
t.is(util.getDocsUrl(), url);
1718
});

util.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22
const fs = require('fs');
33
const path = require('path');
4+
const pkg = require('./package');
45

56
const functionExpressions = [
67
'FunctionExpression',
@@ -105,7 +106,7 @@ const repoUrl = 'https://github.com/avajs/eslint-plugin-ava';
105106
*/
106107
const getDocsUrl = (ruleName, commitHash) => {
107108
ruleName = ruleName || path.basename(module.parent.filename, '.js');
108-
commitHash = commitHash || 'master';
109+
commitHash = commitHash || `v${pkg.version}`;
109110
return `${repoUrl}/blob/${commitHash}/docs/rules/${ruleName}.md`;
110111
};
111112
exports.getDocsUrl = getDocsUrl;

0 commit comments

Comments
 (0)