From a6df9114b1024b429aaf0ff9458a5c3adfb31d8b Mon Sep 17 00:00:00 2001 From: kangetsu121 <34597587+kangetsu121@users.noreply.github.com> Date: Tue, 6 Aug 2024 20:57:08 +0900 Subject: [PATCH] feat(rule): add `dotInIgnore` option (#153) * chore: Format markdown * feat(rule): add `dotInIgnore` option * docs: add `dotInIgnore` option --- README.md | 33 +++++++++++++++++++++------------ src/no-dead-link.ts | 10 ++++++---- test/no-dead-link.ts | 11 +++++++++-- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 646fc42..ab38ac6 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,15 @@ The primary target of this rule is Markdown documents, but it also works on plai ## Installation -``` -$ npm install textlint-rule-no-dead-link +```shell +npm install textlint-rule-no-dead-link ``` ## Usage -``` -$ npm install textlint textlint-rule-no-dead-link -$ textlint --rule textlint-rule-no-dead-link text-to-check.txt +```shell +npm install textlint textlint-rule-no-dead-link +textlint --rule textlint-rule-no-dead-link text-to-check.txt ``` ## Features @@ -60,8 +60,9 @@ The default options are: "checkRelative": true, "baseURI": null, "ignore": [], - "preferGET": [], + "dotInIgnore": false, "ignoreRedirects": false, + "preferGET": [], "retry": 3, "userAgent": "textlint-rule-no-dead-link/1.0", "maxRetryTime": 10, @@ -112,6 +113,14 @@ Example: } ``` +### dotInIgnore + +This rule allows ignore patterns to match filenames starting with a period. +For example, if the `ignore` option contains `"http://example.com/**"` and the `dotInIgnore` option is set to `true`, paths containing filenames that start with `.` (like `"http://example.com/.hidden/index.html"`) will be ignored. +You can disable this behavior by setting `dotInIgnore` to `false`. + +_cf_, + ### preferGET An array of [origins](https://url.spec.whatwg.org/#origin) to lets the rule connect to the origin's URL by `GET` instead of default `HEAD` request. @@ -133,7 +142,7 @@ Example: This rule checks for redirects (3xx status codes) and consider's them an error by default. To ignore redirects during checks, set this value to `false`. -