Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
; http://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.{go,py,rb,php}]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
90 changes: 65 additions & 25 deletions .github/ISSUE_TEMPLATE/bugreport.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,77 @@
name: 'Сообщение о проблеме'
description: 'Issue для сообщения о проблеме или баге'
title: 'Проблема: '
labels: ['bug']
name: "Bug Report"
description: "Report a bug or unexpected behavior"
title: "Bug: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Спасибо, что помогаете улучшить наш проект! Пожалуйста, заполните следующую информацию:
Thanks for reporting! Please fill in the details below.

- type: dropdown
id: linthtml-version
attributes:
label: LintHTML version
options:
- 0.10.x
- 0.9.x
- Other
validations:
required: true

- type: dropdown
id: node-version
attributes:
label: Node.js version
options:
- 24.x
- 22.x
- 20.x
- 18.x
- Other
validations:
required: true

- type: input
id: package-version
attributes:
label: Package version
placeholder: e.g., 2.0.0
validations:
required: true

- type: textarea
id: terminal-error
id: error-output
attributes:
label: Ошибка из терминала
description: |
```bash
label: Error output
description: Paste the linter output from terminal
placeholder: |
File: test/index.html
Config file: index.js
8:3 error The <section> element must contain a heading of any level. htmlacademy/section-has-heading
✖ 1 problem (1 error, 0 warning)
```
8:3 error The <section> element must contain...
validations:
required: true

- type: textarea
id: example
attributes:
label: Часть кода на котором произошла ошибка. Какая конфигурация использовалась
description: |
```html
<section>
<h1>Title</h1>
</section>
```
id: code-sample
attributes:
label: Code sample
description: HTML code that triggers the issue
render: html
validations:
required: true

- type: textarea
id: expected-actual
attributes:
label: Expected vs Actual
description: What should happen vs what happens
validations:
required: true

- type: textarea
id: description
id: steps
attributes:
label: Описание проблемы
description: Пожалуйста, подробно опишите проблему или баг. Опишите как воспроизвести баг
label: Steps to reproduce
description: Only if not obvious from above
validations:
required: false
63 changes: 27 additions & 36 deletions .github/ISSUE_TEMPLATE/new-rule.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,44 @@
name: 'Новое правило'
description: 'Issue для предложения нового правила в линтер'
title: 'Правило: '
labels: ["enhancement"]
name: 'New Rule'
description: 'Propose a new lint rule'
title: 'Rule: '
labels: ['enhancement']
body:
- type: markdown
attributes:
value: |
Спасибо, что нашли временем поделиться новым правилом
Thanks for your rule proposal!

- type: textarea
id: description
attributes:
label: Опишите коротко, что будет проверять правило своими словами
description: Проверяет наличие заголовка любого уровня в `<section>`.
label: Rule description
description: What does this rule check?
placeholder: Checks that <section> elements contain a heading
validations:
required: true

- type: textarea
id: bad-example
id: invalid-examples
attributes:
label: Напишите примеры кода, на которые правило должно выдавать ошибку
description: |
Без заголовка
```html
<section>
<section>
```
label: Invalid code examples
description: Code that should trigger errors
render: html
validations:
required: true

- type: textarea
id: good-example
id: valid-examples
attributes:
label: Напишите примеры кода, на которые правило не должно реагировать
description: |
C заголовком
```html
<section>
<h2></h2>
<section>
```

С любой вложенностью
```html
<section>
<div>
<h2></h2>
</div>
<section>
```
label: Valid code examples
description: Code that should pass
render: html
validations:
required: true

- type: textarea
id: free
id: context
attributes:
label: Поле со свободным описанием.
description: Добавьте сюда всё остальное, что хотели рассказать
label: Additional context
description: Links to specs, edge cases, etc.
validations:
required: false
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- run: npm ci
- run: npm test
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
node_modules/
yarn.lock
.DS_Store
Thumbs.db
.idea
*.sublime*
.idea/
*.lock
.publish
*.sublime*
.vscode/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
50 changes: 28 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Changelog

## 2.0.0 — ???

- **BREAKING:** Renamed `img-svg-req-dimensions` → `replaced-elements-req-dimensions` (now covers all replaced elements, not just SVG)
- `tag-self-close` now explicitly set to `'never'`
- `tag-req-attr`: require `method` attribute on `<form>`

## 1.0.25
Fixes `req-webp-in-picture` to not check `<picture>` if all `<source>` have attribute `type="image/svg+xml"`.
Fixes `req-webp-in-picture` to not check `<picture>` if all `<source>` have attribute `type="image/svg+xml"`.

## 1.0.24
- Adds a `req-tags-presence` rule that requires the specified tags on the page.
Expand Down Expand Up @@ -76,7 +82,7 @@ Added a new rule [htmlacademy/req-stylesheet-link](https://github.com/htmlacadem
```html
<head>
<link rel="stylesheet" href="styles/style.css">
</head>
</head>
```

## 1.0.17
Expand Down Expand Up @@ -159,9 +165,9 @@ The following patterns are **not** considered problems:

```js
'htmlacademy/attr-req-value': [
true,
{
ignore: ['/^data/']
true,
{
ignore: ['/^data/']
}
],
```
Expand Down Expand Up @@ -204,12 +210,12 @@ Fixed `req-charset-utf` rule
- `htmlacademy/req-single-styles`
- `htmlacademy/tag-name-lowercase`
- `htmlacademy/tag-self-close`
- Disabled rules:
- Disabled rules:
- `'class-style'`
- `'spec-char-escape'`
- `tag-self-close`
- `input-req-label`
- Enabled rules:
- Enabled rules:
- `'id-style' : [true, 'dash'],`
- `'input-req-label'`
- `'label-no-enc-textarea-or-select'`
Expand Down Expand Up @@ -288,25 +294,25 @@ Fixed `req-charset-utf` rule
- Fixed `head-meta-charset`

## 1.0.6
- обновили linthtml-rules-htmlacademy 1.0.2
- удалили `htmlacademy/attr-value-style`
- Updated linthtml-rules-htmlacademy 1.0.2
- Removed `htmlacademy/attr-value-style`

## 1.0.5
- Обновили зависимости до актуальных версий
- Добавили linthtml-rules-htmlacademy
- Updated dependencies to latest versions
- Added linthtml-rules-htmlacademy

## 1.0.3
Обновляет зависимости
## 1.0.3
Updated dependencies

## 1.0.2
Разрешили использовать незаполненный `alt="""`
Allowed empty `alt=""`

## 1.0.1
- Обновили правила до linthtml@0.7.2
- Updated rules to linthtml@0.7.2

Новые правила:
- Требуем у `<img>` указывать 4 атрибута
```json
New rules:
- Require 4 attributes on `<img>`
```json
{
"tag-req-attr": [true, {
"img": [
Expand All @@ -318,9 +324,9 @@ Fixed `req-charset-utf` rule
]
}
```
- Убрали требование писать по БЭМ, так как БЭМ может быть слишком разным
- Removed BEM requirement as BEM can vary significantly


## 1.0.0
- Добавили страницы для тестов и сами тесты
- Добавили правила для linthtml@0.6.0
## 1.0.0
- Added test pages and tests
- Added rules for linthtml@0.6.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 HTML Academy
Copyright (c) 2020-2026 HTML Academy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading