Skip to content

no-javascript-url

Detect javascript: URLs.

Severity

error

❌ Incorrect

html
<a href="javascript:void(0)">Click</a>

✅ Correct

html
<button type="button">Click</button>

Reference

Configuration

json
{
  "rules": {
    "no-javascript-url": "error"
  }
}

Released under the MIT License.