Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
14c490f
docs: add design spec for eslint-config and prettier-config test suite
YvetteNikolov Jun 8, 2026
45b5396
docs: add implementation plan for config test suite
YvetteNikolov Jun 8, 2026
d28134e
chore: install vitest at workspace root
YvetteNikolov Jun 8, 2026
12d2b9d
chore: downgrade vitest to v3 for defineWorkspace support
YvetteNikolov Jun 8, 2026
0ec0aab
chore(eslint-config): add vitest setup
YvetteNikolov Jun 8, 2026
1d5d09e
style(eslint-config): use tabs in vitest config
YvetteNikolov Jun 8, 2026
4b502fd
test(eslint-config): add config snapshot test
YvetteNikolov Jun 8, 2026
7b0de9f
fix: hoist prettier, eslint, stylelint in pnpm workspace
YvetteNikolov Jun 8, 2026
aee1b64
test(eslint-config): add behavioral rule tests
YvetteNikolov Jun 8, 2026
d2c4e81
test(eslint-config): add behavioral rule tests
YvetteNikolov Jun 8, 2026
9251d6b
test(eslint-config): add WordPress plugin load verification tests
YvetteNikolov Jun 8, 2026
8b148ca
chore(prettier-config): add vitest setup
YvetteNikolov Jun 8, 2026
6add5a5
fix: hoist eslint-plugin-* to root and add missing babel deps
YvetteNikolov Jun 8, 2026
8fecb79
test(prettier-config): add wp-prettier fork verification and JS forma…
YvetteNikolov Jun 8, 2026
94ffc01
test(prettier-config): add blade format tests
YvetteNikolov Jun 8, 2026
fd21d8f
ci: add test workflow
YvetteNikolov Jun 8, 2026
9fa1b86
chore: add pre-push hook to run tests
YvetteNikolov Jun 8, 2026
9084f9f
refactor: remove deprecated workspace file and create vitest.config.mjs
YvetteNikolov Jun 8, 2026
47b57ee
chore: remove docs
YvetteNikolov Jun 8, 2026
f888ad4
docs: update README regarding testing
YvetteNikolov Jun 8, 2026
2dcaa55
chore: remove version from github action
YvetteNikolov Jun 8, 2026
bd35d65
refactor: test.yml check push to main only
YvetteNikolov Jun 8, 2026
f350454
feat: add NODE_AUTH_TOKEN to test.yml
YvetteNikolov Jun 8, 2026
50e8815
chore: add publishConfig to hopefully make pnpm install on github act…
YvetteNikolov Jun 8, 2026
f5e9a19
chore: update node version in test.yml
YvetteNikolov Jun 8, 2026
90f7e70
chore: update test to exclude absolute path
YvetteNikolov Jun 8, 2026
f98c0ef
chore: format:js
YvetteNikolov Jun 8, 2026
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
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test

on:
push:
branches:
- main
pull_request:

Comment on lines +3 to +8
jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 24
cache: 'pnpm'
Comment on lines +18 to +21
registry-url: 'https://npm.pkg.github.com'

- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Run tests
run: pnpm test
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm test
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,25 @@ pnpm dep:outdated # Check for outdated dependencies across workspaces
pnpm dep:update # Update all dependencies
```

## 📝 Testing

```bash
pnpm test
```

Added to catch two types of problems:
- **Dependency updates** silently changing rules
- **Our own config edits** disabling or weakening rules

Each package has two test files:
- `config.snapshot.test.js` — snapshots the full config and fails on a change
- `rules.test.js` / `format.test.js` — behavioral tests that lint/format real code snippets

Tests run on pre-push and in GitHub Actions on every pull request.

## 🎨 Formatting & Linting

The linting in this monorepo uses the settings defined in the child packages.
Husky (CaptainHook alternative) ensures that all files are automatically formatted and linted with each commit.
The linting in this monorepo uses the settings defined in the child packages. Husky ensures that all files are automatically formatted and linted with each commit.

## About us

Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
},
"license": "EUPL-1.2",
"private": true,
"publishConfig": {
"registry": "https://npm.pkg.github.com/@yardinternet"
},
"packageManager": "pnpm@10.33.0",
"scripts": {
"test": "vitest run",
"lint:js": "yard-toolkit lint js -m custom ./packages/**/src/**/*.js",
"format:js": "yard-toolkit format js -m custom ./packages/**/*.js",
"dep:check": "syncpack list-mismatches",
Expand All @@ -21,9 +25,13 @@
},
"type": "commonjs",
"devDependencies": {
"@babel/core": "^7.29.7",
"@babel/eslint-parser": "^7.25.7",
"@yardinternet/toolkit": "workspace:*",
"husky": "^9.1.7",
"lerna": "^9.0.4",
"lint-staged": "^16.2.7",
"syncpack": "^14.0.0"
"syncpack": "^14.0.0",
"vitest": "^3.2.6"
}
}
7 changes: 6 additions & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Eslint configuration",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "vitest run"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
Expand All @@ -18,6 +18,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@babel/eslint-parser": "^7.25.7",
"@babel/preset-react": "^7.29.7",
"@eslint/compat": "^2.1.0",
Comment on lines 20 to 23
"@eslint/eslintrc": "^3.3.3",
Expand All @@ -29,5 +30,9 @@
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-react-hooks": "^7.1.1",
"globals": "^17.6.0"
},
"devDependencies": {
"eslint": "^9.39.4",
"vitest": "^3.2.6"
}
}
Loading
Loading