Skip to content

Rule request: Disallow protocolless URLS #348

Open
@coliff

Description

@coliff

URLs without specifying the protocol are regarded as an anti-pattern and advised against in the Google HTML Style Guide: https://google.github.io/styleguide/htmlcssguide.html#Protocol

I'd like to request an option in HTMLHint to disallow protocolless URLs, so that I get a warning if I add for example any of these:

<script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.8.2/css/all.css">

Webhint has this rule:
https://webhint.io/docs/user-guide/hints/hint-no-protocol-relative-urls/

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR neededfeature requestFunctionality that introduces a new featurehelp wantedWe are looking for community helpkeep-unstaleThe issue will not be marked as stale by the stale-bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions