webhintio / hint

💡 A hinting engine for the web

Home Page:https://webhint.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] Create code action for Modern DOCTYPE hint

mliao95 opened this issue · comments

See documentation on hint here: https://webhint.io/docs/user-guide/hints/hint-doctype/

Triggers + Code Action solutions (in HTML file):

  • If the first line or lines preceding doctype declaration is not whitespace.
    • Code Action: Move existing doctype declaration to the top of the file.
  • If the user uses an old or legacy doctype
    • Code Action: Change doctype to <!doctype html>
  • If there are multiple doctype declarations in the file
    • Code Action: Remove second doctype or allow user to choose a doctype declaration to keep and move to the top of the file

Edit: Also add this hint to activate in the default webhint config