Repository navigation
Conversation
JS (wp-scripts lint-js): - Wrap every script in an arrow IIFE and use const: classic scripts share the global scope and several declare the same names (el, __, ...), so top-level const would throw a redeclaration SyntaxError. - Name the demo blocks' edit functions Edit, so useBlockProps() is called from a component (react-hooks/rules-of-hooks). - Use window.FileReader instead of a file-wide no-undef disable. - Complete the Openverse picker's JSDoc types; Prettier formatting. CSS (wp-scripts lint-style): - Merge the duplicate .interface-interface-skeleton rule. - Remove the @media rule whose '//' comment made its selector invalid, so it never applied; the .admin-bar rule after it covers that breakpoint through Blockbase's --wpadmin-bar--height. - Break the long outline-button selectors at a descendant combinator. PHP (PHPCS): - Remove the dead if ( false ) mobile branch, the unused $hook parameter, and the mobile-only gutenberg-content-mobile.php and style-mobile.css. - Remove the editor styles loop: get_block_editor_settings() overwrites 'styles' with core's own, so it was dead (and used file_get_contents()). - Remove frontenberg_site_title(), orphaned since its filters were dropped, and the wp_rich_edit global write, which the user_can_richedit filter already covers. - Version and explicit in_footer for script enqueues; postbox gets core's version (and a note on why the theme registers it at all). - 'gutenberg' text domain strings to 'wporg', wp_json_encode, wp_parse_url, Yoda, doc comments, and phpcbf formatting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Stacked on #82, which adds the lint tooling and configs. Merge that first; this PR's base will then switch to
trunk.After this,
npm run lint:js,lint:cssandlint:phpall pass with 0 errors and 0 warnings. Ignoring whitespace, the diff is +202/−810; most of the rest is re-indentation from wrapping scripts in IIFEs and removing a deadif ( false )branch. Review with "Hide whitespace".JS
const. Swappingvarforconstdirectly isn't safe: these are classic scripts sharing one global scope, and several declare the same names (elin three files,__, …). Top-levelconstwould throw a redeclarationSyntaxErrorand stop the script.editfunctions are now namedEditcomponents, souseBlockProps()satisfiesreact-hooks/rules-of-hooks.editor-modifications.jsuseswindow.FileReader. A file-wide/* eslint-disable no-undef */had been hiding thatFileReaderwasn't a known global.Functiontypes), plus Prettier formatting.CSS
.interface-interface-skeletonrule is merged into one.@media (max-width: 782px)rule. Its inline//comment made the selector invalid, so it never applied. The.admin-barrule after it already covers that breakpoint, because Blockbase sets--wpadmin-bar--heightto 46px on mobile.PHP
if ( false )static-mobile branch, which was disabled in ece1110. Its only assets,gutenberg-content-mobile.phpandstyle-mobile.css, are deleted too, along with the now-unused$hookparameter.get_block_editor_settings()overwritesstyleswith core's own (array_merge( $global_styles, get_block_editor_theme_styles() )), so it never had an effect. It also usedfile_get_contents().frontenberg_site_title(), orphaned since its filters were removed in 3ff0c32.$GLOBALS['wp_rich_edit']write. Theuser_can_richeditfilter right after it already forcestrue.filemtime(), and$in_footeris now explicit. They stay in the header, which preserves the current load order.postboxkeeps its theme registration with core's version, plus a comment on why it's needed: core only registerspostboxin wp-admin, andwp-edit-postdepends on it. I found that out by removing it.'gutenberg'text domain strings are now'wporg', pluswp_json_encode(),wp_parse_url(), a Yoda condition, file and function doc comments, andphpcbfformatting.Testing
Chrome, local wp-env on WP 7.2-beta1, logged out, fresh
localStorage:core/shortcodeunregistered, "Submit for Review" shows as "Publish", the URL stays on/, and no unload warning after edits.users/merequests.postboxloads, and the editor layout offsets are 0 with fullscreen on and off.🤖 Generated with Claude Code