Rule request: Disallow protocolless URLS
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 474
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
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/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation files or tests are named. Start by reviewing HTMLHint's existing rule and option conventions, then use the protocol-relative URL examples in the issue to define the cases covered; done means HTMLHint warns when such URLs are encountered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100