script-type
What it does
Section titled “What it does”Reports a <script> whose type is a JavaScript MIME type (text/javascript, application/javascript, …) or empty. type="module" and other types are not reported.
Why it matters
Section titled “Why it matters”The browser assumes that type, so the attribute says nothing and is only more text.
To fix, remove the type.
Example
Section titled “Example”<!DOCTYPE html><title>x</title><script type="text/javascript"></script><script type="module"></script><script></script>...Configuration
Section titled “Configuration”angular: lint: rules: script-type: warn # off (default), warn, errorhtml: lint: rules: script-type: warn # off (default), warn, errorsvelte: lint: rules: script-type: warn # off (default), warn, errorvue: lint: rules: script-type: warn # off (default), warn, errorEnabled by the presets: html/html-validate-recommended.
Suppress one line with sudsy-disable-next-line script-type in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| html-validate | script-type |
partial | the JavaScript MIME types and an empty type; the allowed module and importmap types are not special |