Fixes req-webp-in-picture
to not check <picture>
if all <source>
have attribute type="image/svg+xml"
.
- Adds a
req-tags-presence
rule that requires the specified tags on the page. - Adds a
req-preload-font
rule that requires thepreload
value for the font. - Adds a
req-webp-in-picture
rule that requireswebp
in<picture>
- Adds a
no-class-in-container
rule that checks theclass
attribute for child elements inside the specified container.
{
"htmlacademy/req-tags-presence": [ true, ["header", "nav", "main", "section", "h1", "footer"]],
"htmlacademy/req-preload-font": true,
"htmlacademy/req-webp-in-picture": true,
"htmlacademy/no-class-in-container": [true, {
"containers": ["content"],
"ignore": {
"tags": ["h1", "p"],
"classes": ["content__title"]
}
}]
}
Update dependencies. Adds a tag-forbid-attr
rule that disallows the use of specified attributes on the specified tag.
Added a new rule htmlacademy/req-source-width-height that requires the width
and height
attributes of <source>
, inside <picture>
.
<picture>
<source srcset="images/image-tablet.jpg" width="768" height="480" media="(min-width: 768px)">
<img src="images/image-mobile.jpg" width="320" height="148" alt="">
</picture>
Clarifies the no-blocking-script rule for the <script>
tag. You can now add modules to <head>
.
<html lang="ru">
<head>
<script src="app.js" type="module"></script>
</head>
<body>…</body>
</html>
Updates the @linthtml/linthtml to the latest version
Added a new rule htmlacademy/req-mailto, which requires mailto:
for email-text links.
{
"htmlacademy/req-mailto": true
}
<a href="mailto:[email protected]">[email protected]</a>
Added a new rule htmlacademy/req-stylesheet-link that checks for a link tag with the rel="stylesheet"
attribute inside the head tag.
{
"htmlacademy/req-stylesheet-link": true
}
<head>
<link rel="stylesheet" href="styles/style.css">
</head>
- Excludes the
<input type="submit">
check from the input-req-label rule. - Adds
ignore
option for tag-req-attr
'input': [
{
name: 'name',
ignore: {
'type': 'submit'
}
},
],
Fix htmlacademy/attr-req-value
rule
A single <option>
in <select>
may have an empty value for the value
attribute if it is selected by default.
The following pattern is not considered a problem:
<label for="fruits">Fruits</label>
<select id="fruits" name="fruits" required>
<option value="">Select...</option>
<option value="banana">Banana</option>
<option value="apple">Apple</option>
</select>
Added htmlacademy/space-between-comments
rules: {
'htmlacademy/space-between-comments': [true, 'space' | 'no-space]
}
This rule checks for spaces at the beginning and end of the comment block.
string
: "space"|"no-space"
If a comment has spaces at both the beginning and end of the comment block, it is compliant.
The following patterns are considered problematic:
<!-- Comment-->
<!--Comment -->
<!--Comment-->
The following patterns are not considered problems:
<!-- Comment -->
If a comment has no spaces at both the beginning and end of the comment block, it is compliant.
The following patterns are considered problematic:
<!-- Comment-->
<!--Comment -->
<!-- Comment -->
The following patterns are not considered problems:
<!--Comment-->
attr-req-value
can now accept regex for ignore
'htmlacademy/attr-req-value': [
true,
{
ignore: ['/^data/']
}
],
Disabled attr-new-line
rule
Fixed regex in attr-name-ignore-regex
Disabled link-min-length-4
This rule triggered for a good example
<a class="logo" href="markup-4-index.html">
<img src="img/logo.svg" width="63" height="52" alt="Логотип сайта гостиницы для котов и кошек Котейка">
</a>
Fixed req-charset-utf
rule
- Update linthtml-rules-htmlacademy
- Sorted htmlacademy rules
- Added so many new rules:
htmlacademy/attr-req-value
htmlacademy/aria-label-misuse
htmlacademy/attr-delimiter
htmlacademy/attribute-allowed-values
htmlacademy/ban-url-spaces
htmlacademy/id-no-dup
htmlacademy/input-req-label
htmlacademy/link-req-content
htmlacademy/no-blocking-script
htmlacademy/no-px-size
htmlacademy/req-head-styles
htmlacademy/req-meta-viewport
htmlacademy/req-single-styles
htmlacademy/tag-name-lowercase
htmlacademy/tag-self-close
- Disabled rules:
'class-style'
'spec-char-escape'
tag-self-close
input-req-label
- Enabled rules:
'id-style' : [true, 'dash'],
'input-req-label'
'label-no-enc-textarea-or-select'
'no-surrounding-whitespace'
'link-min-length-4'
'tag-self-close' : [true, 'never']
- Adds:
{
'tag-req-attr': [
true,
{
'input': [
{
name: 'name'
},
],
'select': [
{
name: 'name'
},
],
'textarea': [
{
name: 'name'
},
],
'time': [
{
name: 'datetime'
},
],
'source': [
{
name: 'type'
},
],
'button': [
{
name: 'type'
},
],
'a': [
{
name: 'href'
},
],
}
]
}
- Update linthtml-rules-htmlacademy
- Adds new rule
htmlacademy/section-has-heading
<section>
<h2>title</h2>
</section>
<section>
<div>
<h2>title</h2>
</div>
</section>
- Update linthtml-rules-htmlacademy
- Adds htmlacademy rules
- Remove bem for id
- Remove
indent-style
- Remove
line-no-trailing-whitespace
- Remove
link-req-noopener
- Adds
spec-char-escape
- Fixed
head-meta-charset
- обновили linthtml-rules-htmlacademy 1.0.2
- удалили
htmlacademy/attr-value-style
- Обновили зависимости до актуальных версий
- Добавили linthtml-rules-htmlacademy
Обновляет зависимости
Разрешили использовать незаполненный alt="""
- Обновили правила до [email protected]
Новые правила:
- Требуем у
<img>
указывать 4 атрибута{ "tag-req-attr": [true, { "img": [ {"name": "src"}, {"name": "alt"}, {"name": "width"}, {"name": "height"} ]} ] }
- Убрали требование писать по БЭМ, так как БЭМ может быть слишком разным
- Добавили страницы для тестов и сами тесты
- Добавили правила для [email protected]