Skip to content

Commit

Permalink
Update @types/mdast, utilities, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 23, 2023
1 parent deb011d commit f873061
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 151 deletions.
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @typedef {import('mdast').Root} Root
* @typedef {import('mdast').StaticPhrasingContent} StaticPhrasingContent
* @typedef {import('mdast').PhrasingContent} PhrasingContent
* @typedef {import('mdast-util-find-and-replace').ReplaceFunction} ReplaceFunction
* @typedef {{input: string, index: number}} Match
*
Expand Down Expand Up @@ -190,7 +190,7 @@ export default function remarkGithub(options = {}) {
base = link.user
}

/** @type {StaticPhrasingContent[]} */
/** @type {PhrasingContent[]} */
const children = []

if (link.page === 'issues' || link.page === 'pull') {
Expand Down Expand Up @@ -242,7 +242,7 @@ export default function remarkGithub(options = {}) {

if (!url) return false

/** @type {StaticPhrasingContent} */
/** @type {PhrasingContent} */
let node = {type: 'text', value}

if (options.mentionStrong !== false) {
Expand Down Expand Up @@ -360,7 +360,7 @@ export default function remarkGithub(options = {}) {

if (!url) return false

/** @type {StaticPhrasingContent[]} */
/** @type {PhrasingContent[]} */
const nodes = []
let value = ''

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@
"index.js"
],
"dependencies": {
"@types/mdast": "^3.0.0",
"mdast-util-find-and-replace": "^2.0.0",
"mdast-util-to-string": "^3.0.0",
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0"
"@types/mdast": "^4.0.0",
"mdast-util-find-and-replace": "^3.0.0",
"mdast-util-to-string": "^4.0.0",
"unified": "^11.0.0",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"c8": "^8.0.0",
"prettier": "^3.0.0",
"remark": "^14.0.0",
"remark": "^15.0.0",
"remark-cli": "^11.0.0",
"remark-gfm": "^3.0.0",
"remark-gfm": "^4.0.0",
"remark-preset-wooorm": "^9.0.0",
"type-coverage": "^2.0.0",
"type-fest": "^2.0.0",
"type-fest": "^4.0.0",
"typescript": "^5.0.0",
"vfile": "^5.0.0",
"vfile": "^6.0.0",
"xo": "^0.56.0"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/issue-project/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ A project-SHA is not relative to the current project.

GitHub’s project names can include alphabetical characters, dashes, and full-stops. They may end in a TLD (such as `.com`), but may not end in `.git` (for obvious reasons).

* This is a valid issue: [foo/bar#1](https://github.com/foo/bar/issues/1);
* So is this: [foo/bar#123456789](https://github.com/foo/bar/issues/123456789).
* This is a valid issue: [foo/bar#1](https://github.com/foo/bar/issues/1);
* So is this: [foo/bar#123456789](https://github.com/foo/bar/issues/123456789).

They work here
[foo/bar#1](https://github.com/foo/bar/issues/1)
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/issue-user/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ A user-issue is relative to the project, but relative to the user’s fork.

GitHub’s usernames can contain alphabetical characters and dashes, but can neither begin nor end with a dash. Additionally, the length of a username can be between 1 and 39 characters (both including).

* This is a valid issue: [username#1](https://github.com/username/remark/issues/1);
* So is this: [username#123456789](https://github.com/username/remark/issues/123456789).
* This is a valid issue: [username#1](https://github.com/username/remark/issues/1);
* So is this: [username#123456789](https://github.com/username/remark/issues/123456789).

They work here
[username#1](https://github.com/username/remark/issues/1)
Expand Down
10 changes: 6 additions & 4 deletions test/fixtures/issue/output.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Issue

* This is a valid issue: [#1](https://github.com/wooorm/remark/issues/1), and so is this: [GH-1](https://github.com/wooorm/remark/issues/1);
* So are these: [#123456789](https://github.com/wooorm/remark/issues/123456789), and: [GH-123456789](https://github.com/wooorm/remark/issues/123456789);
* And these: [gH-1](https://github.com/wooorm/remark/issues/1), [Gh-1](https://github.com/wooorm/remark/issues/1), and [gh-1](https://github.com/wooorm/remark/issues/1).
* This is a valid issue: [#1](https://github.com/wooorm/remark/issues/1), and so is this: [GH-1](https://github.com/wooorm/remark/issues/1);
* So are these: [#123456789](https://github.com/wooorm/remark/issues/123456789), and: [GH-123456789](https://github.com/wooorm/remark/issues/123456789);
* And these: [gH-1](https://github.com/wooorm/remark/issues/1), [Gh-1](https://github.com/wooorm/remark/issues/1), and [gh-1](https://github.com/wooorm/remark/issues/1).

These will always be a header in pedantic mode (remark requires initial spaces for ATX-headings)
[#1](https://github.com/wooorm/remark/issues/1)

Or here

#1
```
#1
```

But these will always work:
[GH-1](https://github.com/wooorm/remark/issues/1)
Expand Down
80 changes: 40 additions & 40 deletions test/fixtures/sha-project/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,49 @@ A project-SHA is not relative to the current project.

GitHub’s project names can include alphabetical characters, dashes, and full-stops. They may end in a TLD (such as `.com`), but may not end in `.git` (for obvious reasons).

* foo/bar\@000000;
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000000000000000);
* foo/bar\@00000000000000000000000000000000000000000.
* foo/bar\@000000;
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/00000000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/000000000000000000000000000000000000000);
* [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000000000000000000000000000000000000);
* foo/bar\@00000000000000000000000000000000000000000.

And:

* Prefix [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000) suffix;
* Prefix [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000)!;
* a [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000)!;
* Prefix [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000) suffix;
* Prefix [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000)!;
* a [foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000)!;

And what about here
[foo/bar@`0000000`](https://github.com/foo/bar/commit/0000000)
Expand Down
80 changes: 40 additions & 40 deletions test/fixtures/sha-user/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,49 @@ A user-SHA is relative to the project, but relative to the user’s fork.

GitHub’s usernames can contain alphabetical characters and dashes, but can neither begin nor end with a dash. Additionally, the length of a username can be between 1 and 39 characters (both including).

* username\@000000;
* [username@`0000000`](https://github.com/username/remark/commit/0000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000000000000000);
* username\@00000000000000000000000000000000000000000.
* username\@000000;
* [username@`0000000`](https://github.com/username/remark/commit/0000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/00000000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/000000000000000000000000000000000000000);
* [username@`0000000`](https://github.com/username/remark/commit/0000000000000000000000000000000000000000);
* username\@00000000000000000000000000000000000000000.

And:

* Prefix [username@`0000000`](https://github.com/username/remark/commit/0000000) suffix;
* Prefix [username@`0000000`](https://github.com/username/remark/commit/0000000)!;
* a [username@`0000000`](https://github.com/username/remark/commit/0000000)!;
* Prefix [username@`0000000`](https://github.com/username/remark/commit/0000000) suffix;
* Prefix [username@`0000000`](https://github.com/username/remark/commit/0000000)!;
* a [username@`0000000`](https://github.com/username/remark/commit/0000000)!;

And what about here
[username@`0000000`](https://github.com/username/remark/commit/0000000)
Expand Down

0 comments on commit f873061

Please sign in to comment.