Skip to content

Conversation

@obenland
Copy link
Member

@obenland obenland commented Dec 17, 2025

Summary

  • Add .eslintignore to exclude non-transpiled assets/ directory from linting
  • Apply auto-fixable lint fixes to source files and rebuild
  • Fix JSDoc annotations with proper types and descriptions
  • Fix react-hooks/exhaustive-deps warnings with useCallback
  • Add JS linting to pre-commit hook for changed JS/JSX/TS/TSX files

Test plan

  • Verify npm run lint:js passes with no errors or warnings
  • Verify npm run build completes successfully
  • Verify all JS tests pass with npm run test:unit:js

- Add .eslintignore to exclude non-transpiled assets/ directory
- Simplify .distignore with .* wildcard for all dotfiles
- Apply auto-fixable lint fixes to source files and rebuild
- Fix JSDoc annotations with proper types and descriptions
Copilot AI review requested due to automatic review settings December 17, 2025 16:16
@obenland obenland added the Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary. label Dec 17, 2025
@github-actions github-actions bot added [Block] Federated reply Respond to posts, notes, videos, and other content on the fediverse. [Block] Follow Me [Block] Followers [Block] Post settings [Block] Reactions [Block] Remote Reply aka "Reply on the Fediverse", in the comment list [Feature] Reactions [Focus] Editor Changes to the ActivityPub experience in the block editor labels Dec 17, 2025
pfefferle
pfefferle previously approved these changes Dec 17, 2025
@obenland obenland marked this pull request as draft December 17, 2025 16:21
Copy link

Copilot AI left a comment

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 addresses JavaScript linting issues across the codebase by standardizing JSDoc annotations, applying auto-fixable lint rules, and updating configuration files. The changes improve code consistency and ensure the project adheres to modern JavaScript best practices.

  • Standardizes JSDoc annotations by changing @returns to @return, capitalizing type names to lowercase (Stringstring), and replacing @var with @member
  • Applies ESLint auto-fixes including letconst for immutable variables, improved JSDoc parameter alignment, and simplified control flow
  • Adds .eslintignore to exclude the assets/ directory and simplifies .distignore using .* wildcard

Reviewed changes

Copilot reviewed 29 out of 33 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/e2e/config/global-setup.js Updated JSDoc to use @return instead of @returns
src/shared/use-user-options.js Standardized JSDoc parameter alignment and return annotation
src/shared/use-options.js Changed @returns to @return
src/shared/modal/index.js Fixed JSDoc types, alignment, changed let to const, simplified nested if-else
src/shared/inherit-block-fallback.js Updated return annotation
src/reply/edit.js Fixed ellipsis character, improved JSDoc alignment
src/remote-reply/view.js Changed type names to lowercase, @var to @member, @returns to @return
src/reactions/view.js Updated JSDoc types, added braces to single-line if statement
src/reactions/reactions.js Added empty @property tag (incomplete documentation)
src/reactions/edit.js Added missing setAttributes parameter documentation
src/reactions/deprecation.js Improved JSDoc parameter documentation with destructured properties
src/reactions/tests/deprecation.test.js Added JSDoc for mock function
src/followers/view.js Standardized JSDoc types and return annotations
src/followers/deprecations.js Enhanced parameter documentation with property details
src/followers/tests/deprecation.test.js Fixed parameter alignment in JSDoc
src/follow-me/view.js Updated types, changed function* to *function generator syntax
src/follow-me/edit.js Improved JSDoc with detailed parameter documentation
src/follow-me/deprecation.js Enhanced parameter docs with destructured properties
src/follow-me/button-style.js Standardized JSDoc parameter alignment
src/follow-me/tests/deprecation.test.js Added parameter documentation to helper function
src/editor-plugin/plugin.js Changed @var to @member, updated return annotations
bin/precommit/sort-php-imports.js Changed let to const for immutable variable
bin/precommit/check-unused-imports.js Applied letconst fixes in multiple locations
.eslintignore Added to exclude assets/ directory from linting
.distignore Simplified by replacing individual dotfile entries with .* wildcard
build/* Rebuilt files reflecting source changes with updated version hashes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Remove broken extends reference to non-existent @wordpress/scripts tsconfig
- Add full TypeScript compiler options directly in tsconfig.json
- Add build/, node_modules/, vendor/ to .eslintignore
- Remove incomplete JSDoc typedef in reactions.js
- Fix all react-hooks/exhaustive-deps warnings by adding missing
  dependencies and wrapping callbacks in useCallback/useMemo
- Update tsconfig.json to resolve React type version mismatch between
  project types and @wordpress/element bundled types using paths
- Change moduleResolution to 'bundler' and jsx to 'react-jsx'
- Fix JSDoc param documentation (replace 'root0' placeholders with
  descriptive names, add missing param descriptions)
- Remove '- ' prefixes from JSDoc param descriptions for consistency
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 54 out of 61 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Use anchors instead of buttons for editor pagination to ensure
visual consistency with frontend across all themes. Added
eslint-disable comments explaining the intentional bypass.
Run lint:js on changed JS/JSX/TS/TSX files during pre-commit
to catch lint errors before they're committed.
@obenland obenland requested a review from Copilot December 17, 2025 20:18
@obenland obenland marked this pull request as ready for review December 17, 2025 20:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 66 out of 73 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (2)

build/app/feed-content.108d0161.js:4

  • Variable 't' is used before its declaration.
    build/app/feed-content.108d0161.js:4
  • This statement is unreachable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

obenland and others added 2 commits December 17, 2025 16:43
Get all changed files once and filter by type to reduce redundant git
calls as more file type checks are added.
pfefferle
pfefferle previously approved these changes Dec 18, 2025
@obenland obenland requested a review from pfefferle December 18, 2025 15:48
@obenland obenland merged commit 4dccd06 into trunk Dec 18, 2025
7 checks passed
@obenland obenland deleted the fix/js-lint branch December 18, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Federated reply Respond to posts, notes, videos, and other content on the fediverse. [Block] Follow Me [Block] Followers [Block] Post settings [Block] Reactions [Block] Remote Reply aka "Reply on the Fediverse", in the comment list [Feature] Reactions [Feature] Reader [Focus] Editor Changes to the ActivityPub experience in the block editor Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants