Skip to content

Commit 0eac036

Browse files
fix: rules having broken links to docs (#310)
1 parent 3172c12 commit 0eac036

File tree

4 files changed

+143
-3
lines changed

4 files changed

+143
-3
lines changed

.releaserc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ plugins:
1010
- changelogTitle: "# Changelog
1111

1212
All notable changes to this project will be documented in this file. Dates are displayed in UTC."
13+
- - "@google/semantic-release-replace-plugin"
14+
- replacements:
15+
- files:
16+
- "./lib/**/*"
17+
from: "\\$\\{__VERSION__\\}"
18+
to: "${nextRelease.version}"
19+
results:
20+
- file: "./lib/index.js"
21+
hasChanged: true
22+
numMatches: 1
23+
numReplacements: 1
24+
- file: "./lib/index.mjs"
25+
hasChanged: true
26+
numMatches: 1
27+
numReplacements: 1
28+
countMatches: true
1329
- "@semantic-release/git"
1430
- "@semantic-release/npm"
1531
- - "@semantic-release/github"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"devDependencies": {
7070
"@commitlint/cli": "^13.2.1",
7171
"@commitlint/config-conventional": "^14.1.0",
72+
"@google/semantic-release-replace-plugin": "^1.1.0",
7273
"@istanbuljs/nyc-config-typescript": "^1.0.1",
7374
"@rebeccastevens/eslint-config": "^1.1.5",
7475
"@rollup/plugin-commonjs": "^21.0.0",

src/util/rule.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { ESLintUtils } from "@typescript-eslint/experimental-utils";
33
import type { Rule } from "eslint";
44
import type { Node, Type } from "typescript";
55

6-
import { version } from "~/package.json";
6+
// eslint-disable-next-line @typescript-eslint/naming-convention, no-underscore-dangle -- This is a special var.
7+
const __VERSION__ = "0.0.0-development";
78

89
export type BaseOptions = object;
910

@@ -92,7 +93,7 @@ export function createRule<
9293
): Rule.RuleModule {
9394
return ESLintUtils.RuleCreator(
9495
(name) =>
95-
`https://github.com/jonaskello/eslint-plugin-functional/blob/v${version}/docs/rules/${name}.md`
96+
`https://github.com/jonaskello/eslint-plugin-functional/blob/v${__VERSION__}/docs/rules/${name}.md`
9697
)({
9798
name,
9899
meta,

yarn.lock

Lines changed: 123 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,15 @@
845845
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210"
846846
integrity sha512-82cpyJyKRoQoRi+14ibCeGPu0CwypgtBAdBhq1WfvagpCZNKqwXbKwXllYSMG91DhmG4jt9gN8eP6lGOtozuaw==
847847

848+
"@google/semantic-release-replace-plugin@^1.1.0":
849+
version "1.1.0"
850+
resolved "https://registry.yarnpkg.com/@google/semantic-release-replace-plugin/-/semantic-release-replace-plugin-1.1.0.tgz#71316d584efb9feb1267fc7576e50ff6919c02f2"
851+
integrity sha512-LaBZmayyxa9eSxJP0dH1FhF3Ye7aXmmkvIGPqR+kA1BxIpEfUqaKk+50puVJ2ERfEPitPmuG2A1utDqMgOgkeg==
852+
dependencies:
853+
jest-diff "^26.5.2"
854+
lodash "^4.17.20"
855+
replace-in-file "^6.1.0"
856+
848857
"@humanwhocodes/config-array@^0.6.0":
849858
version "0.6.0"
850859
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.6.0.tgz#b5621fdb3b32309d2d16575456cbc277fa8f021a"
@@ -887,6 +896,17 @@
887896
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
888897
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==
889898

899+
"@jest/types@^26.6.2":
900+
version "26.6.2"
901+
resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e"
902+
integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==
903+
dependencies:
904+
"@types/istanbul-lib-coverage" "^2.0.0"
905+
"@types/istanbul-reports" "^3.0.0"
906+
"@types/node" "*"
907+
"@types/yargs" "^15.0.0"
908+
chalk "^4.0.0"
909+
890910
"@nodelib/[email protected]":
891911
version "2.1.3"
892912
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b"
@@ -1386,6 +1406,25 @@
13861406
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
13871407
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
13881408

1409+
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
1410+
version "2.0.4"
1411+
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"
1412+
integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==
1413+
1414+
"@types/istanbul-lib-report@*":
1415+
version "3.0.0"
1416+
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686"
1417+
integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==
1418+
dependencies:
1419+
"@types/istanbul-lib-coverage" "*"
1420+
1421+
"@types/istanbul-reports@^3.0.0":
1422+
version "3.0.1"
1423+
resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff"
1424+
integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==
1425+
dependencies:
1426+
"@types/istanbul-lib-report" "*"
1427+
13891428
"@types/json-schema@*":
13901429
version "7.0.7"
13911430
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
@@ -1457,6 +1496,18 @@
14571496
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d"
14581497
integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==
14591498

1499+
"@types/yargs-parser@*":
1500+
version "20.2.1"
1501+
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129"
1502+
integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==
1503+
1504+
"@types/yargs@^15.0.0":
1505+
version "15.0.14"
1506+
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.14.tgz#26d821ddb89e70492160b66d10a0eb6df8f6fb06"
1507+
integrity sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ==
1508+
dependencies:
1509+
"@types/yargs-parser" "*"
1510+
14601511
"@typescript-eslint/eslint-plugin@^5.0.0":
14611512
version "5.3.0"
14621513
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.3.0.tgz#a55ae72d28ffeb6badd817fe4566c9cced1f5e29"
@@ -1669,7 +1720,7 @@ ansi-regex@^4.1.0:
16691720
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
16701721
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
16711722

1672-
ansi-regex@^5.0.1:
1723+
ansi-regex@^5.0.0, ansi-regex@^5.0.1:
16731724
version "5.0.1"
16741725
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
16751726
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
@@ -2993,6 +3044,11 @@ dezalgo@^1.0.0:
29933044
asap "^2.0.0"
29943045
wrappy "1"
29953046

3047+
diff-sequences@^26.6.2:
3048+
version "26.6.2"
3049+
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1"
3050+
integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==
3051+
29963052
diff@^4.0.1:
29973053
version "4.0.2"
29983054
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
@@ -4836,6 +4892,21 @@ java-properties@^1.0.0:
48364892
resolved "https://registry.yarnpkg.com/java-properties/-/java-properties-1.0.2.tgz#ccd1fa73907438a5b5c38982269d0e771fe78211"
48374893
integrity sha512-qjdpeo2yKlYTH7nFdK0vbZWuTCesk4o63v5iVOlhMQPfuIZQfW/HI35SjfhA+4qpg36rnFSvUK5b1m+ckIblQQ==
48384894

4895+
jest-diff@^26.5.2:
4896+
version "26.6.2"
4897+
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394"
4898+
integrity sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==
4899+
dependencies:
4900+
chalk "^4.0.0"
4901+
diff-sequences "^26.6.2"
4902+
jest-get-type "^26.3.0"
4903+
pretty-format "^26.6.2"
4904+
4905+
jest-get-type@^26.3.0:
4906+
version "26.3.0"
4907+
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0"
4908+
integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==
4909+
48394910
js-string-escape@^1.0.1:
48404911
version "1.0.1"
48414912
resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef"
@@ -6510,6 +6581,16 @@ prettier@^2.4.1:
65106581
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.1.tgz#671e11c89c14a4cfc876ce564106c4a6726c9f5c"
65116582
integrity sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==
65126583

6584+
pretty-format@^26.6.2:
6585+
version "26.6.2"
6586+
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93"
6587+
integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==
6588+
dependencies:
6589+
"@jest/types" "^26.6.2"
6590+
ansi-regex "^5.0.0"
6591+
ansi-styles "^4.0.0"
6592+
react-is "^17.0.1"
6593+
65136594
pretty-ms@^7.0.1:
65146595
version "7.0.1"
65156596
resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8"
@@ -6629,6 +6710,11 @@ rc@^1.2.8:
66296710
minimist "^1.2.0"
66306711
strip-json-comments "~2.0.1"
66316712

6713+
react-is@^17.0.1:
6714+
version "17.0.2"
6715+
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
6716+
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
6717+
66326718
read-cmd-shim@^2.0.0:
66336719
version "2.0.0"
66346720
resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz#4a50a71d6f0965364938e9038476f7eede3928d9"
@@ -6782,6 +6868,15 @@ repeat-string@^1.6.1:
67826868
resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
67836869
integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc=
67846870

6871+
replace-in-file@^6.1.0:
6872+
version "6.3.2"
6873+
resolved "https://registry.yarnpkg.com/replace-in-file/-/replace-in-file-6.3.2.tgz#0f19835137177c89932f45df319f3539a019484f"
6874+
integrity sha512-Dbt5pXKvFVPL3WAaEB3ZX+95yP0CeAtIPJDwYzHbPP5EAHn+0UoegH/Wg3HKflU9dYBH8UnBC2NvY3P+9EZtTg==
6875+
dependencies:
6876+
chalk "^4.1.2"
6877+
glob "^7.2.0"
6878+
yargs "^17.2.1"
6879+
67856880
request@^2.88.2:
67866881
version "2.88.2"
67876882
resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3"
@@ -7346,6 +7441,15 @@ string-width@^4.1.0, string-width@^4.2.0:
73467441
is-fullwidth-code-point "^3.0.0"
73477442
strip-ansi "^6.0.0"
73487443

7444+
string-width@^4.2.3:
7445+
version "4.2.3"
7446+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
7447+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
7448+
dependencies:
7449+
emoji-regex "^8.0.0"
7450+
is-fullwidth-code-point "^3.0.0"
7451+
strip-ansi "^6.0.1"
7452+
73497453
string-width@^5.0.0:
73507454
version "5.0.1"
73517455
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.0.1.tgz#0d8158335a6cfd8eb95da9b6b262ce314a036ffd"
@@ -8093,6 +8197,11 @@ yargs-parser@^20.2.2, yargs-parser@^20.2.3:
80938197
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
80948198
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
80958199

8200+
yargs-parser@^21.0.0:
8201+
version "21.0.0"
8202+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.0.tgz#a485d3966be4317426dd56bdb6a30131b281dc55"
8203+
integrity sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==
8204+
80968205
yargs@^15.0.2:
80978206
version "15.4.1"
80988207
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
@@ -8136,6 +8245,19 @@ yargs@^17.0.0:
81368245
y18n "^5.0.5"
81378246
yargs-parser "^20.2.2"
81388247

8248+
yargs@^17.2.1:
8249+
version "17.3.1"
8250+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.3.1.tgz#da56b28f32e2fd45aefb402ed9c26f42be4c07b9"
8251+
integrity sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==
8252+
dependencies:
8253+
cliui "^7.0.2"
8254+
escalade "^3.1.1"
8255+
get-caller-file "^2.0.5"
8256+
require-directory "^2.1.1"
8257+
string-width "^4.2.3"
8258+
y18n "^5.0.5"
8259+
yargs-parser "^21.0.0"
8260+
81398261
81408262
version "3.1.1"
81418263
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"

0 commit comments

Comments
 (0)