diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0bfd9ad --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 351c879..0000000 --- a/.eslintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "env": { - "es2022": true, - "node": true - }, - "extends": [ - "htmlacademy/vanilla" - ], - "rules": { - "camelcase": [2, { - "ignoreDestructuring": true - }] - } -} diff --git a/.github/ISSUE_TEMPLATE/bugreport.yml b/.github/ISSUE_TEMPLATE/bugreport.yml deleted file mode 100644 index da05a4d..0000000 --- a/.github/ISSUE_TEMPLATE/bugreport.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: 'Сообщение о проблеме' -description: 'Issue для сообщения о проблеме или баге' -title: 'Проблема: ' -labels: ['bug'] -body: - - type: markdown - attributes: - value: | - Спасибо, что помогаете улучшить наш проект! Пожалуйста, заполните следующую информацию: - - - type: textarea - id: terminal-error - attributes: - label: Ошибка из терминала - description: Введите ошибку из терминала - placeholder: | - ```bash - File: test/index.html - Config file: index.js - 8:3 error The
element must contain a heading of any level. htmlacademy/section-has-heading - ✖ 1 problem (1 error, 0 warning) - ``` - - type: textarea - id: example - attributes: - label: Часть кода на котором произошла ошибка - description: Скопируйте часть кода на который неправильно реагирует линтер - placeholder: | - ```html -
-

Title

-
- ``` - - - type: textarea - id: description - attributes: - label: Описание проблемы - description: Пожалуйста, подробно опишите проблему или баг diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 0086358..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1 +0,0 @@ -blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/new-rule.yml b/.github/ISSUE_TEMPLATE/new-rule.yml deleted file mode 100644 index ce03d24..0000000 --- a/.github/ISSUE_TEMPLATE/new-rule.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: 'Новое правило' -description: 'Issue для предложения нового правила в линтер' -title: 'Правило: ' -labels: ["enhancement"] -body: - - type: markdown - attributes: - value: | - Спасибо, что нашли временем поделиться новым правилом - - - type: textarea - id: description - attributes: - label: Краткое описание - description: Опишите коротко, что будет проверять правило своими словами - placeholder: Проверяет наличие заголовка любого уровня в `
`. - - - type: textarea - id: bad-example - attributes: - label: Плохие примеры - description: Напишите примеры кода, на которые правило должно выдавать ошибку - placeholder: | - Без заголовка - ```html -
-
- ``` - - - type: textarea - id: good-example - attributes: - label: Хорошие примеры - description: Напишите примеры кода, на которые правило не должно реагировать - placeholder: | - C заголовком - ```html -
-

-
- ``` - - С любой вложенностью - ```html -
-
-

-
-
- ``` - - - type: textarea - id: free - attributes: - label: Поле со свободным описанием. - description: Добавьте сюда всё остальное, что хотели рассказать diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml deleted file mode 100644 index 6457c96..0000000 --- a/.github/workflows/eslint.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: ESLint - -on: - pull_request: - branches: - - main -jobs: - eslint: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3.5.3 - - - name: Setup Node.js - uses: actions/setup-node@v3.7.0 - with: - node-version: 18 - - - name: Install dependencies - run: npm ci - - - name: Run ESLint - run: npm run eslint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b8d1646 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: 24 + cache: npm + - run: npm ci + - run: npm test diff --git a/.gitignore b/.gitignore index 4e13ab3..2ff5851 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ -/node_modules -yarn.lock +._* .DS_Store -Thumbs.db -.idea -*.sublime* -*.lock -.publish +*.local.* +.worktrees/ +node_modules/ +.idea/ +.vscode/ +.zed/ +docs/ +plan/ diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..18ffde0 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +@htmlacademy:registry=https://registry.npmjs.org/ diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24 diff --git a/CHANGELOG.md b/CHANGELOG.md index f06b16d..7a9b82e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,45 @@ # Changelog +## 2.0.0 — 2026-05-20 + +### Breaking + +- Migrated to ESM. The plugin now requires Node.js >= 24 and is loaded via ESM `import`. Configs that reference the plugin by name (`plugins: ["linthtml-rules-htmlacademy"]` in `.linthtmlrc`) keep working. +- Renamed `htmlacademy/img-svg-req-dimensions` → `htmlacademy/replaced-elements-req-dimensions`. The renamed rule also covers `