Repository navigation
Fix the PHPCS and theme validation errors - #42
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
The json schema still needs to be reverted back to trunk. |
The theme validator enforced an exact match against Requires at least, so it rejected trunk. I updated it to accept either, while still validating properties against the Requires at least schema. |
The trunk merge dropped @wordpress/env from package.json and the lock file, which left the env:* scripts without a binary, and removed the allowScripts entry from WordPress#40. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
# Conflicts: # README.md # bin/validate-theme.mjs # package-lock.json # phpcs.xml.dist
Note
Part 3 of 3 in the lint stack. Please merge in this order:
Until #33 and #40 merge, this PR also shows their commits. Changes in this PR only
Fixes everything the linters from #33 report. With this merged, both Lint jobs pass,
npm run lintis clean, and the pre-commit hook from #40 stops blocking commits to these files.What changed
PHPCS (all 30 patterns)
composer format. For example,esc_html_e('Page not found.', 'ipsum');?>is nowesc_html_e( 'Page not found.', 'ipsum' ); ?>.@package Ipsumand@since Ipsum 1.0, followed by a blank line.footer.php,footer-wide.phpandhero-epigraph.php,echo sprintf()is nowprintf(), and the PHP sits on its own lines.Theme validator
queryId: removed from the Query Loop in 14 patterns. These IDs came from editor exports and were never used: no query turns on enhanced pagination, and each one either follows the main query or has no pagination. The editor assigns a fresh ID when the block loads.single.phpandsingle-sidebar.phpnow goes throughesc_attr_e(), like the other translated block attributes.$schema: pinned to 7.1 intheme.jsonand the 13 style variations. These are the same lines Point the theme.json schema at trunk #27 changes, so whichever PR merges second won't conflict.color,styleandwidthfrom thecore/accordion-headingandcore/detailsborders intheme.json. WordPress skips empty values when it builds CSS, so the dotted top border renders as before.The JSON files keep trunk's tab indentation. Apart from
$schemaand the removed nulls, their data is unchanged.Testing
With PHP, Composer, and Node 24.18+ (
nvm use):Both checks should pass, and so should the Lint jobs on this PR. Then compare the front end and the Site Editor with trunk, especially the footer, the hero epigraph pattern, single posts with tags, and the accordion and details blocks.
Follow-up to #10.