docs: add design spec for eslint-config and prettier-config test suite#133
Merged
Conversation
There was a problem hiding this comment.
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 testintegration 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 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
parenSpacingattribuut, Bij elke push doet hij eerst eenpnpm run test. Ook is er een GitHub action toegevoegd die op PR naarmainde tests afschiet.