Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@
"trailingComma": "none"
},
"dependencies": {
"fs-extra": "^8.1.0",
"get-url-origin": "^1.0.1",
"minimatch": "^3.0.4",
"node-fetch": "^2.6.0",
"p-memoize": "^3.1.0",
"p-queue": "^6.2.0",
"textlint-rule-helper": "^2.2.4"
Expand All @@ -54,7 +52,6 @@
"@types/minimatch": "^5.1.2",
"@types/mocha": "^10.0.0",
"@types/node": "^24.3.0",
"@types/node-fetch": "^2.6.2",
"lint-staged": "^16.1.5",
"mocha": "^11.7.1",
"prettier": "^3.6.2",
Expand Down
116 changes: 0 additions & 116 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions src/no-dead-link.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { RuleHelper } from "textlint-rule-helper";
import fetch, { RequestInit } from "node-fetch";
import URL from "url";
import fs from "fs/promises";
import minimatch from "minimatch";
Expand Down Expand Up @@ -109,10 +108,6 @@ const createFetchWithRuleDefaults = (ruleOptions: Options) => {
const { host } = URL.parse(uri);
return fetch(uri, {
...fetchOptions,
// Disable gzip compression in Node.js
// to avoid the zlib's "unexpected end of file" error
// https://github.com/request/request/issues/2045
compress: false,
// Some website require UserAgent and Accept header
// to avoid ECONNRESET error
// https://github.com/textlint-rule/textlint-rule-no-dead-link/issues/111
Expand Down Expand Up @@ -168,11 +163,11 @@ const createCheckAliveURL = (ruleOptions: Options) => {
maxRetryCount: number = 3,
currentRetryCount: number = 0
): Promise<AliveFunctionReturn> {
const opts: RequestInit = {
const opts = {
method,
// Use `manual` redirect behaviour to get HTTP redirect status code
// and see what kind of redirect is occurring
redirect: "manual"
redirect: "manual" as RequestRedirect
};
try {
const res = await fetchWithDefaults(uri, opts);
Expand Down
Loading