Automated Testing: Allow console logging in all bin, scripts, tools files#78312
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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. |
There was a problem hiding this comment.
Hm, I didn't necessarily expect scripts to exempt the entire package here (as opposed to e.g. a scripts/ directory within a package), though based on what the scripts package actually is, I suppose the exception makes sense for the entire package.
|
Size Change: 0 B Total Size: 7.96 MB ℹ️ View Unchanged
|
|
The ESLint errors are rather interesting and surprising: The pattern I don't think files in this package should be ignoring the Gutenberg-wide configuration. In practice that would likely mean shuffling files around. Maybe renaming Curious for your impressions here @manzoorwanijk . Personally I feel like we should probably have an In the interim, I might just go ahead and restore those |
Scripts package doesn't currently respect project-level ESLint configuration. See: #78312 (comment)
|
Flaky tests detected in 10e53e2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25883753470
|
manzoorwanijk
left a comment
There was a problem hiding this comment.
Thank you for reducing the noise here.
One idea I have is that we could use {
"exports": {
"./config/eslint.config.cjs": "./config/eslint/config.cjs",
"./config/eslint": "./config/eslint/config.cjs",
// ...
}
}Plus maybe a deprecation notice for anyone importing through |
|
Sorry, I missed that comment earlier. I has a similar situation when I migrated ESLint config to |
|
I created a follow-up issue at #78346 so we can explore what a solution would look like. |
…iles (#78312) * Automated Testing: Allow console logging in all bin, scripts, tools files * Restore no-console disabling in scripts package Scripts package doesn't currently respect project-level ESLint configuration. See: WordPress/gutenberg#78312 (comment) Co-authored-by: aduth <[email protected]> Co-authored-by: manzoorwanijk <[email protected]> Co-authored-by: Mamaduka <[email protected]> Source: WordPress/gutenberg@a387624
What?
Expands the existing
no-consoleexceptions to apply tobin/,tools/, andscripts/files anywhere in the project.Why?
The same reason we're exempting them in the root applies throughout the codebase: we care to prevent console logging if it would be made visible to users at runtime, but scripts are a valid use-case for logging to stdout.
This also helps remove a bunch of noise throughout the code where we have to disable the rule for valid uses that are now exempted at the project level.
Testing Instructions
npm run lint:jsshould pass.Use of AI Tools
Cursor + Claude Opus 4.7 was used in initial exploration, but all code changes were created manually.