diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 5a773aace..000000000 --- a/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -coverage/ -dist/ -node_modules/ -public/assets/ -temp/ diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 3bf380c83..000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,65 +0,0 @@ -require("@html-validate/eslint-config/patch/modern-module-resolution"); - -module.exports = { - root: true, - extends: ["@html-validate"], - - rules: { - "import/extensions": "off", - "security/detect-unsafe-regex": "off", - }, - - overrides: [ - { - /* ensure cjs and mjs files are linted too */ - files: ["*.cjs", "*.mjs"], - }, - { - files: "*.ts", - extends: ["@html-validate/typescript"], - rules: { - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unnecessary-condition": "off", - }, - }, - { - files: ["docs/examples/**/*.[jt]s"], - rules: { - "@typescript-eslint/no-var-requires": "off", - "eslint-comments/require-description": "off", - "import/no-duplicates": "off", - "import/no-extraneous-dependencies": "off", - "import/no-unresolved": "off", - "tsdoc/syntax": "off", - "no-console": "off", - }, - }, - { - files: ["src/**/*.ts"], - excludedFiles: ["src/**/*.spec.ts"], - parserOptions: { - tsconfigRootDir: __dirname, - project: ["./tsconfig.json"], - }, - extends: ["@html-validate/typescript-typeinfo"], - rules: { - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unnecessary-condition": "off", - }, - }, - { - files: "*.spec.[jt]s", - excludedFiles: ["cypress/**", "tests/e2e/**"], - extends: ["@html-validate/jest"], - }, - { - /* files which should lint even if project isn't build yet */ - files: ["./*.d.ts", "bin/*.js"], - rules: { - "import/export": "off", - "import/extensions": "off", - "import/no-unresolved": "off", - }, - }, - ], -}; diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..56f334a75 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: html-validate diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa612cab7..fd2776238 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: node:latest +image: node:22 include: - template: Jobs/Dependency-Scanning.gitlab-ci.yml @@ -43,20 +43,22 @@ NPM: - node --version - npm --version - npm ci --no-fund --no-audit --no-update-notifier - - npm audit --json --production | npx --yes gitlab-npm-audit-parser -o gl-dependency-scanning.json || true + - npm audit --json --omit=dev | npx --yes gitlab-npm-audit-parser -o gl-dependency-scanning.json || true - npx sort-package-json --check Build: stage: build artifacts: name: ${CI_PROJECT_PATH_SLUG}-${CI_PIPELINE_ID}-build + when: always paths: - dist/ - - src/generated + - src/generated/ + - temp/ script: - npm run --if-present build - npm pack - - npm exec npm-pkg-lint + - npm exec npm-pkg-lint -- --ignore-node-version=18 - | for dts in dist/{cjs,es}/{index,browser,jest,test-utils}.d.ts; do if [[ ! -e "${dts}" ]]; then @@ -126,15 +128,18 @@ Prettier: Docs: stage: test + dependencies: [] + needs: [] artifacts: reports: junit: temp/jest.xml script: + - npm ci - npm run codegen + - npm run build - npm run docs - - npm run htmlvalidate -- --formatter codeframe --config docs/htmlvalidate-templates.json 'docs/**/*.html' - npm run htmlvalidate -- --formatter codeframe --config docs/htmlvalidate-public.json 'public/**/*.html' - - npm test -- docs + - npm test -- --no-coverage docs - npm exec eslint docs/examples - git status - test -z "$(git status --porcelain)" || (echo 'working copy dirty, need to commit updated specs'; exit 1) @@ -147,8 +152,9 @@ Docs: - npm ci --no-fund --no-audit --no-update-notifier script: - npm run codegen - - npm test -- --no-coverage --testPathIgnorePatterns matchers tests/jest tests/vitest - npm run --if-present build + - npm test -- --no-coverage --ci --testPathIgnorePatterns matchers --workerThreads 1 --logHeapUsage -- src tests/jest + - npm run -w tests/vitest test - npm run compatibility Node: @@ -156,9 +162,14 @@ Node: parallel: matrix: - VERSION: - - 16 - - 18 - - 20 + - "18.19" + - "18" + - "20.6" + - "20" + - "22.0" + - "22" + variables: + NODE_OPTIONS: "--max_old_space_size=4096" image: node:${VERSION} Jest compat: @@ -171,6 +182,7 @@ Jest compat: - 27 - 28 - 29 + - 30 before_script: - npm ci --no-fund --no-audit --no-update-notifier - npm run build @@ -186,7 +198,7 @@ Jest compat: - > npm rm rollup-plugin-dts - > - npm install + npm install --force @jest/core@${JEST_VERSION} jest@${JEST_VERSION} jest-circus@${JEST_VERSION} @@ -215,17 +227,28 @@ Jest compat: @types/jest script: - sed 's#/src/browser.ts#/dist/cjs/browser.js#g' -i package.json + # older jest/ts-jest versions doesn't work with bundler so use nodenext instead + - sed '/moduleResolution/s/bundler/nodenext/' -i tsconfig.json - if [[ "${MATRIX}" -eq "25" ]]; then sed -i '/"paths"/i"baseUrl":"./",' tsconfig.json; fi - for spec in tests/jest/*.spec.ts; do sed 's#../../src#../../dist/cjs#g' -i "${spec}"; done - - npm exec jest -- --no-coverage --ci -- tests/jest + - npm exec jest -- --no-coverage --ci --logHeapUsage -- tests/jest Vitest compat: stage: compatibility dependencies: [] needs: [] + parallel: + matrix: + - VERSION: + - 0 + - 1 + - 2 + - 3 before_script: - npm ci --no-fund --no-audit --no-update-notifier - npm run build + - npm install -w tests/vitest --include-workspace-root $(npx -y npm-min-peer vitest --major ${VERSION} --with-name) + - npm ls vite vitest script: - npm run -w tests/vitest test @@ -242,11 +265,10 @@ Module: - BUILD: - esm - cjs - before_script: - - (cd tests/integration/${BUILD} && npm install) script: - npm exec tsc -- --build tests/integration/${BUILD} - node tests/integration/${BUILD} + - npm exec html-validate tests/integration/${BUILD}-cli .release: stage: release @@ -257,6 +279,7 @@ Module: GIT_COMMITTER_EMAIL: ${HTML_VALIDATE_BOT_EMAIL} before_script: - npm install -g $(node -p 'require("./package.json").release.extends') + - node --version Dry run: extends: .release @@ -264,18 +287,23 @@ Dry run: dependencies: [] rules: - if: '$CI_COMMIT_REF_NAME == "master"' + - if: '$CI_COMMIT_REF_NAME == "next"' - if: '$CI_COMMIT_REF_NAME =~ /^release\//' script: - npm exec semantic-release -- --dry-run Release: extends: .release + tags: + - saas-linux-small-amd64 id_tokens: SIGSTORE_ID_TOKEN: aud: sigstore rules: - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "web"' when: manual + - if: '$CI_COMMIT_REF_NAME == "next" && $CI_PIPELINE_SOURCE == "web"' + when: manual - if: '$CI_COMMIT_REF_NAME =~ /^release\// && $CI_PIPELINE_SOURCE == "web"' when: manual script: diff --git a/.husky/commit-msg b/.husky/commit-msg index e1db975f2..f81e82c7e 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -exec npm exec commitlint -- --edit "$1" +npm exec commitlint -- --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index 111856ec3..2faaf427d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,2 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - configfile=$(node -p 'require.resolve("@html-validate/prettier-config/lint-staged")') -exec npm exec lint-staged -- --config "${configfile}" "$@" +npm exec lint-staged -- --config "${configfile}" "$@" diff --git a/.husky/pre-push b/.husky/pre-push index 5c219ab1d..8853b52d9 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,6 +1,3 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - # bail out on first error set -e @@ -16,5 +13,4 @@ npm exec eslint -- --max-warnings 0 . npm run prettier:check echo Lint documentation -npm run htmlvalidate -- --formatter codeframe --config docs/htmlvalidate-templates.json 'docs/**/*.html' npm run htmlvalidate -- --formatter codeframe --config docs/htmlvalidate-public.json 'public/**/*.html' diff --git a/.prettierignore b/.prettierignore index 4664d680e..317d43349 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,4 @@ # generated by npm -package.json package-lock.json # compiled files diff --git a/CHANGELOG.md b/CHANGELOG.md index 60a7e07b4..0dbeb1772 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,25 +1,640 @@ # html-validate changelog -## [8.5.0](https://gitlab.com/html-validate/html-validate/compare/v8.4.1...v8.5.0) (2023-10-01) +## 9.7.1 (2025-06-28) + +### Bug Fixes + +- **docs:** fix typo in docs navigation ([1a2b87a](https://gitlab.com/html-validate/html-validate/commit/1a2b87a4eca16562f3738067245ce4be140dcf7d)) +- **rules:** `no-raw-characters` ignores boolean attributes in favor of `attribute-allowed-values` ([22b18be](https://gitlab.com/html-validate/html-validate/commit/22b18be4aa3c25c205d0f735a3da6824edbe31ae)), closes [#296](https://gitlab.com/html-validate/html-validate/issues/296) +- **rules:** allow aria-label on `` ([bd07810](https://gitlab.com/html-validate/html-validate/commit/bd07810dd2cddf61f2893d1e051126c39c4207b0)), closes [#304](https://gitlab.com/html-validate/html-validate/issues/304) +- **vitest:** fix matchers augmentation for typescript ([7c4bb69](https://gitlab.com/html-validate/html-validate/commit/7c4bb69a1bda07f266c4cff5b751526ebfb05595)) + +## 9.7.0 (2025-06-15) + +### Features + +- add special `templateRoot` meta property for `