Ignoring domains
User guide
- Getting Started
Api
Concepts
Configurations
Configuring webhint
Connectors
Development flow integration
Extensions
Formatters
Hints
- Avoid CSS limits
- Avoid HTTP redirects
- axe accessibility check
- Babel configuration hint set
- Compatibility of CSS, HTML and JavaScript features
- Correct `Content-Type` header
- Correct manifest extension
- Correct viewport
- Detect CSS Reflows
- Disallowed HTTP headers
- External links disown opener
- Has web app manifest
- Highest document mode
- HTTP cache
- Leading '.' in `classList.add` or `classList.remove`
- Manifest has name
- Minify JavaScript
- Modern DOCTYPE
- No `createElement` with SVG
- No `P3P` headers
- No broken links
- No byte-order mark
- No Inline CSS Styles
- No protocol-relative URLs
- No small error pages
- No vulnerable libraries
- Nu HTML test
- Optimal compression
- Optimize images
- Performance budget
- Prefixed CSS first
- scoped-svg-styles
- Specify button type
- SSL server test
- TypeScript configuration hints set
- Unneeded HTTP headers
- Use `Strict-Transport-Security` header
- Use `X-Content-Type-Options` header
- Use Apple touch icon
- Use charset `utf-8`
- Use HTTPS
- Use subresource integrity
- Valid `Set-Cookie` header
- Valid `theme-color`
- Valid manifest
- webpack configuration hints set
Parsers
Server configurations
Troubleshoot
- Api
- Concepts
- Configurations
- Configuring webhint
- Connectors
- Development flow integration
- Extensions
- Formatters
- Hints
- Parsers
- Server configurations
- Troubleshoot
Ignoring domains
Sometimes you don’t have control over all the infrastructure and there
is nothing you can do about it. Reporting errors in those cases generates
noise and frustration. Instead of globally disabling a hint you might
want to turn it off for a domain, or directly ignore completely one (like
a third party analytics, ads, etc.). To achieve this you need to add the
ignoredUrls
property to your .hintrc
file:
"ignoredUrls": [{
"domain": ".*\\.domain1\\.com/.*",
"hints": ["*"]
}, {
"domain": "www.domain2.net",
"hints": ["disallowed-headers"]
}] |
Properties can be:
- regular expressions, like
.*\\.domain1\\.com/.*
. This will match:something.domain1.com/index.html
somethingelse.domain1.com/image.png
- some text, like
www.domain2.net
. In this case, if the resource URL contains the text, it will be a match. E.g.:www.domain2.net/index.php
www.domain2.net/image.png
The value of the property has to be an array of strings where the strings can be:
*
if you want to ignore all hints for the given domain.- The ID of the hint to be ignored.
In the previous example we will:
- Ignore all hints for any resource that matches the regex
.*\\.domain1\\.com/.*
. - Ignore the hint
disallowed-headers
for the domainwww.domain2.net
.
Some hints also have a default ignore list to avoid false positives in certain contexts (e.g. cache headers when developing on localhost). These default values can be overriden by specifying your own ignore list for those specific hints.