Skip to main content

href-style

If set, the content of the href attribute must follow the specified format.

Options

Possible values :

  • "absolute": All href attribute must use absolute URLs.
  • "relative": All href attribute must use relative URLs.
  • false: No restriction.

Links to fragments (those starting with #) are not checked.

Given:

  "href-style": [true, "relative"]

The following patterns are considered violations:

  <a href="https://github.com/">Link</a>
  <a href="http://localhost:4200/">Link</a>

The following patterns are not considerd violations:

  <a href="/page">Link</a>