0.0.5 • Published 4 months ago

@sfdocs-internal/remark-lint-no-dead-url v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Remark lint No Dead URL

What and Why

This plugin is similar to remark-lint-no-dead-urls in nature of functionality as well as implementation. The only difference is it 've an extra couple of configuration option that helps you to consider URLs as alive based on HTTP response code and domain name.

The original remark-lint-no-dead-urls only validates if the response code is 200 else it says that the URL is dead. By adding following config we can mark URLs alive based on response code or ask user to validate URLs manually.

  • aliveStatusCodes: an array of numeric HTTP Response codes that indicate that the link is alive. Entries in this array can also be regular expressions (without global flag).
    • Example: [200, /^45{2}$/]. Default value is [ /[1,2,3][012345][012345678]/, /[4][0][0123567]/ ].
    • The default value of aliveStatusCodes validates for all 1XX, 2XX, 3XX, and few 4XX as well.
  • domainsBehindAuth: an array of domains that has URLs behind authentication and accessible only if you’re logged in.

How to set up

Install & build

yarn install && yarn build

Publish

npm publish

Make sure to push your changes (version number & other changes) to git when publishing is complete.