Skip to content

docs: add design spec for eslint-config and prettier-config test suite#133

Merged
YvetteNikolov merged 27 commits into
mainfrom
feat/testing-for-linting-and-formatting
Jun 8, 2026
Merged

docs: add design spec for eslint-config and prettier-config test suite#133
YvetteNikolov merged 27 commits into
mainfrom
feat/testing-for-linting-and-formatting

Conversation

@YvetteNikolov

Copy link
Copy Markdown
Contributor

Ik wilde alle dependencies gaan updaten, maar je hebt, naast het linken naar een project, niet een goed overzicht met of alles nog goed werkt of dat er andere problemen zijn.

Daarom deze tests geschreven voor ESlint en Prettier. Uiteraard met Claude. Checkt alle ESlint en Prettier rules, including de parenSpacing attribuut, Bij elke push doet hij eerst een pnpm run test. Ook is er een GitHub action toegevoegd die op PR naar main de tests afschiet.

Copilot AI review requested due to automatic review settings June 8, 2026 14:18
@YvetteNikolov YvetteNikolov requested a review from a team as a code owner June 8, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a Vitest-based regression test suite for the @yardinternet/eslint-config and @yardinternet/prettier-config packages to detect rule/config changes caused by dependency upgrades or config edits, and wires these tests into local (pre-push) and CI workflows.

Changes:

  • Add Vitest multi-project setup at the repo root plus per-package Vitest configs.
  • Add snapshot + behavioral tests for both ESLint (flat config) and Prettier (including parenSpacing / wp-prettier fork verification).
  • Add pnpm test integration via root script, Husky pre-push hook, and a GitHub Actions workflow.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vitest.config.mjs Root Vitest config that runs the package-level test projects.
README.md Documents how to run the new pnpm test suite and what it covers.
pnpm-workspace.yaml Adds publicHoistPattern affecting workspace dependency resolution.
pnpm-lock.yaml Lockfile updates for newly introduced test/tooling dependencies.
packages/prettier-config/vitest.config.mjs Vitest config for the Prettier config package tests.
packages/prettier-config/tests/format.test.js Behavioral formatting tests (wp-prettier fork + overrides).
packages/prettier-config/tests/config.snapshot.test.js Snapshot tests for Prettier config (excluding plugin absolute paths).
packages/prettier-config/tests/__snapshots__/format.test.js.snap Snapshot output for Blade formatting behavior.
packages/prettier-config/tests/__snapshots__/config.snapshot.test.js.snap Snapshot of stable Prettier config options.
packages/prettier-config/package.json Replaces placeholder test script with vitest run and adds Vitest devDependency.
packages/eslint-config/vitest.config.mjs Vitest config for the ESLint config package tests.
packages/eslint-config/tests/rules.test.js Behavioral linting tests validating key rules and plugin loading.
packages/eslint-config/tests/config.snapshot.test.js Snapshot tests for config length/rules/files patterns.
packages/eslint-config/tests/__snapshots__/config.snapshot.test.js.snap Snapshot baseline for ESLint config.
packages/eslint-config/package.json Adds Vitest/ESLint devDeps and adds @babel/eslint-parser dependency.
package.json Adds root test script and devDependencies needed to run the suite.
.husky/pre-push Runs pnpm test before pushes.
.github/workflows/test.yml Adds CI workflow to run pnpm test on pushes/PRs.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines 20 to 23
"dependencies": {
"@babel/eslint-parser": "^7.25.7",
"@babel/preset-react": "^7.29.7",
"@eslint/compat": "^2.1.0",
Comment on lines +15 to +19
function messagesForRule( code, ruleId, filename = TEST_FILE ) {
return linter
.verify( code, config, { filename } )
.filter( ( m ) => m.ruleId === ruleId );
}
Comment thread pnpm-workspace.yaml
Comment on lines +4 to +12
publicHoistPattern:
- prettier
- stylelint
- eslint
- eslint-*
- eslint-plugin-*
- '@eslint/*'
- '@typescript-eslint/*'
- '@wordpress/eslint-plugin'
Comment on lines +3 to +6
on:
push:
pull_request:

Comment on lines +18 to +21
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
@YvetteNikolov YvetteNikolov merged commit a705937 into main Jun 8, 2026
2 checks passed
@YvetteNikolov YvetteNikolov deleted the feat/testing-for-linting-and-formatting branch June 8, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants