Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignoreRedirect is not working properly #131

Open
amimas opened this issue May 7, 2020 · 0 comments
Open

ignoreRedirect is not working properly #131

amimas opened this issue May 7, 2020 · 0 comments

Comments

@amimas
Copy link

amimas commented May 7, 2020

The instruction in the Readme has following regarding the ignoreRedirects option:

ignoreRedirects

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.

To ignore redirects, the value needs to be set to true (not false)

Also, I have been running into issues where only "certain" redirects are not being ignored. This is my config at the moment:

{
  "rules": {
    "no-dead-link": {
      "checkRelative": false,
      "ignore": [
        "https://github.com/**"
      ],
      "ignoreRedirects": true
    }
  }
}

The following links recently started failing the validation in my CI:

  51:23  error  https://www.youtube.com/watch?time_continue=2&v=Th6NeEC4b74 is dead. (302 Found)  no-dead-link
  65:40  error  https://www.youtube.com/watch?v=CZSibdgGUds is dead. (302 Found)  no-dead-link

The linter is getting 302 response code which should ignore it based on my configuration, but it's being reported as dead link.

Another example:

74:279 error http://jquery.com/ is dead. (301 Moved Permanently) no-dead-link
  19:114  error  https://elasticpath.com/contact-us is dead. (301 Moved Permanently)  no-dead-link

Even in this case, it's not ignoring the redirect. If I set ignoreRedirects to false, I have a lot more dead links being reported because of those links being redirected. But, not sure why certain links are still reported as dead when the status code is 3xx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant