diff --git a/packages/remark-lint-local-links-valid/src/index.ts b/packages/remark-lint-local-links-valid/src/index.ts index e781d6228..53d7a6747 100644 --- a/packages/remark-lint-local-links-valid/src/index.ts +++ b/packages/remark-lint-local-links-valid/src/index.ts @@ -75,7 +75,7 @@ const resolveRedirect = ( ): string => { let resolved = url; while (redirects[resolved]) { - resolved = redirects[resolved].split(/[#?]/)[0]; + resolved = redirects[resolved]?.split(/[#?]/)[0] ?? resolved; } return resolved; }; diff --git a/packages/remark-lint-local-links-valid/tsconfig.json b/packages/remark-lint-local-links-valid/tsconfig.json index f81bb51ef..ec6e74ebe 100644 --- a/packages/remark-lint-local-links-valid/tsconfig.json +++ b/packages/remark-lint-local-links-valid/tsconfig.json @@ -1,7 +1,9 @@ { + "extends": "../../tsconfig.json", "compilerOptions": { "target": "ESNext", - "module": "commonjs", + "module": "NodeNext", + "moduleResolution": "NodeNext", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true,