Bump the wordpress-packages group across 1 directory with 4 updates and fix line-js errors#2461
Bump the wordpress-packages group across 1 directory with 4 updates and fix line-js errors#2461mukeshpanchal27 wants to merge 5 commits intotrunkfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2461 +/- ##
==========================================
+ Coverage 69.17% 69.33% +0.16%
==========================================
Files 90 90
Lines 8243 7749 -494
==========================================
- Hits 5702 5373 -329
+ Misses 2541 2376 -165
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Why is this needed? |
I check lint-js on local and get errors on |
|
Curious. Minified JS files should be excluded from linting: Line 26 in 5e1903c |
|
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. |
| @@ -0,0 +1,71 @@ | |||
| /** | |||
| * ESLint flat config (ESLint 8+) | |||
There was a problem hiding this comment.
Pull request overview
Updates WordPress tooling dependencies and migrates the project’s JS linting setup to ESLint flat config, alongside cleanup of previously required inline ESLint disable directives.
Changes:
- Bump
@wordpress/*devDependencies (notably@wordpress/scriptsto v32) and refreshpackage-lock.json. - Replace legacy
.eslintrc.jswith a neweslint.config.jsflat configuration. - Remove several inline ESLint disable comments related to
no-console,camelcase, and an unused rule suppression.
Reviewed changes
Copilot reviewed 5 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Bumps @wordpress/* tooling dependencies (incl. @wordpress/scripts major upgrade). |
package-lock.json |
Updates lockfile to reflect new WordPress tooling and ESLint dependency tree. |
eslint.config.js |
Adds ESLint flat config to replace legacy .eslintrc usage. |
.eslintrc.js |
Removes deprecated legacy ESLint config. |
webpack.config.js |
Removes an inline ESLint disable related to console usage. |
plugins/optimization-detective/detect.js |
Removes inline ESLint disables for console logging in logger. |
bin/validate-json.js |
Removes file-level no-console disable and a rule suppression near timeout handling. |
bin/plugin/lib/logger.js |
Removes inline no-console suppression for console.log. |
bin/plugin/commands/changelog.js |
Removes inline camelcase suppressions for GitHub API fields. |
bin/plugin/cli.js |
Removes inline no-console suppression for error reporting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const importPlugin = require( 'eslint-plugin-import' ); | ||
| const jsdocPlugin = require( 'eslint-plugin-jsdoc' ); | ||
|
|
||
| module.exports = [ |
There was a problem hiding this comment.
eslint.config.js currently defines a standalone flat config but does not extend the base WordPress ESLint configuration previously provided by @wordpress/scripts. This likely drops a large set of WordPress rules/overrides and makes the header comment (“Based on WordPress coding standards”) inaccurate. Consider importing/spreading the config shipped by @wordpress/scripts (config/eslint.config.*) and then layering the few local rule/override tweaks on top (import/no-unresolved ignore + view-transitions definedTypes).
| const importPlugin = require( 'eslint-plugin-import' ); | |
| const jsdocPlugin = require( 'eslint-plugin-jsdoc' ); | |
| module.exports = [ | |
| const wordpressScriptsConfig = require( '@wordpress/scripts/config/eslint.config' ); | |
| const importPlugin = require( 'eslint-plugin-import' ); | |
| const jsdocPlugin = require( 'eslint-plugin-jsdoc' ); | |
| module.exports = [ | |
| ...wordpressScriptsConfig, |
| { | ||
| files: [ '**/*.js' ], | ||
| plugins: { | ||
| import: importPlugin, | ||
| jsdoc: jsdocPlugin, | ||
| }, | ||
| languageOptions: { | ||
| ecmaVersion: 2020, | ||
| sourceType: 'module', | ||
| globals: { | ||
| // Browser | ||
| window: 'readonly', | ||
| document: 'readonly', | ||
| navigator: 'readonly', | ||
| console: 'readonly', | ||
| // WordPress | ||
| wp: 'readonly', | ||
| wpApiSettings: 'readonly', | ||
| }, | ||
| }, |
There was a problem hiding this comment.
This config applies browser globals (window/document/wp) and sourceType: 'module' to all **/*.js, including Node/CommonJS scripts in bin/** and build tooling like webpack.config.js. That can mask environment-specific issues and, if you later re-enable no-undef via a base config, will start flagging CommonJS globals (require/module) incorrectly. Consider splitting into separate overrides for Node/tooling vs browser code (and set appropriate globals/sourceType/ecmaVersion for each).
| const importPlugin = require( 'eslint-plugin-import' ); | ||
| const jsdocPlugin = require( 'eslint-plugin-jsdoc' ); | ||
|
|
There was a problem hiding this comment.
eslint.config.js directly require()s eslint-plugin-import and eslint-plugin-jsdoc, but they are not listed in this repo’s devDependencies (they appear to be transitive via @wordpress/scripts). Because ESLint loads the config at runtime, relying on transitive/hoisted dependencies can break installs if the dependency tree or package manager behavior changes. Prefer extending the @wordpress/scripts config (which wires plugins internally) or add these plugins explicitly to devDependencies.
| "@wordpress/e2e-test-utils-playwright": "^1.44.0", | ||
| "@wordpress/env": "^11.4.0", | ||
| "@wordpress/prettier-config": "^4.44.0", | ||
| "@wordpress/scripts": "^32.0.0", |
There was a problem hiding this comment.
Bumping @wordpress/scripts to v32 pulls in ESLint v10, which (per package-lock) requires Node ^20.19.0 || ^22.13.0 || >=24. The repo’s engines.node currently allows >=20.10.0, so installs/linting may fail or warn on Node 20.10–20.18. Consider updating the Node engine (and any CI/.nvmrc versions) to meet the new minimum required by the updated tooling.
Bumps the wordpress-packages group with 4 updates in the / directory: @wordpress/e2e-test-utils-playwright, @wordpress/env, @wordpress/prettier-config and @wordpress/scripts.
Updates
@wordpress/e2e-test-utils-playwrightfrom 1.43.0 to 1.44.0Changelog
Sourced from
@wordpress/e2e-test-utils-playwright's changelog.Commits
b862d8cchore(release): publisha3c385bUpdate changelog filesbbb9ce0Merge changes published in the Gutenberg plugin "release/23.0" branchUpdates
@wordpress/envfrom 11.3.0 to 11.4.0Changelog
Sourced from
@wordpress/env's changelog.Commits
b862d8cchore(release): publisha3c385bUpdate changelog filesbbb9ce0Merge changes published in the Gutenberg plugin "release/23.0" branchUpdates
@wordpress/prettier-configfrom 4.43.0 to 4.44.0Changelog
Sourced from
@wordpress/prettier-config's changelog.Commits
b862d8cchore(release): publisha3c385bUpdate changelog filesUpdates
@wordpress/scriptsfrom 31.8.0 to 32.0.0Changelog
Sourced from
@wordpress/scripts's changelog.Commits
b862d8cchore(release): publisha3c385bUpdate changelog filesbbb9ce0Merge changes published in the Gutenberg plugin "release/23.0" branch