no-script-style-type
This rule disallows the use of type attributes for style sheets (unless not using CSS) and scripts (unless using a different language than CSS/JavaScript).
Why?
Specifying the type attributes on the following tags is unnecessary as HTML5 implies text/css and text/javascript as defaults.
- script -
type="text/javascript" - style, link -
type="text/css"
How to use
module.exports = {
rules: {
"@html-eslint/no-script-style-type": "error",
},
};
Rule Details
This rule disallows the use of type attributes for style sheets (unless not using CSS) and scripts (unless not using JavaScript).
Examples of incorrect code for this rule:
<script type="text/javascript" src="https://script.js"></script><link type="text/css" rel="stylesheet" href="https://styles.css" /><style type="text/css"></style>Examples of correct code for this rule:
<script src="https://script.js"></script><script type="module" src="https://script.js"></script><link rel="stylesheet" href="https://styles.css" /><style></style>