-
Notifications
You must be signed in to change notification settings - Fork 83
Fix JS lint issues #2657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix JS lint issues #2657
Conversation
- 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
There was a problem hiding this 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
@returnsto@return, capitalizing type names to lowercase (String→string), and replacing@varwith@member - Applies ESLint auto-fixes including
let→constfor immutable variables, improved JSDoc parameter alignment, and simplified control flow - Adds
.eslintignoreto exclude theassets/directory and simplifies.distignoreusing.*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 let → const 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
There was a problem hiding this 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.
There was a problem hiding this 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.
Get all changed files once and filter by type to reduce redundant git calls as more file type checks are added.
Summary
.eslintignoreto exclude non-transpiledassets/directory from lintingTest plan
npm run lint:jspasses with no errors or warningsnpm run buildcompletes successfullynpm run test:unit:js