Automated Testing: Enforce dependencies checks consistently for development files#79703
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. |
1 similar comment
|
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. |
|
Size Change: 0 B Total Size: 7.61 MB |
|
Flaky tests detected in fb769d0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/28459005545
|
manzoorwanijk
left a comment
There was a problem hiding this comment.
This works great. Thank you.
|
TIL that There is an open issue for it - import-js/eslint-plugin-import#585
|
|
Created an upstream PR to add support for We can enable it in a follow-up when/if that PR lands. |
What?
Updates ESLint configuration to enforce import rules consistently, regardless of "development files" status.
Related:
Why?
The reason we have
import/no-extraneous-dependenciesis to ensure packages declare their dependencies. There's nothing special about development files that they should be exempt from this rule.Based on my findings outlined at #79320 (comment), my assumption is that this largely originated as a combination of (a) temporarily ignoring failing files that were deemed "less critical" and (b) limitations of the default ESLint import resolver described in #72136 which have since been resolved.
How?
import/no-extraneous-dependenciesapplying to development files.#76195 will also be helpful here for ensuring isolated dependencies, but as long as we continue using
import/no-extraneous-dependencies, we should be consistent in how it applies to files. The exemptions don't make sense.Separately, I plan to iterate to remove more of these "development file" exemptions, which seems possible but they have their own unique issues to work through. This initial sweep keeps the diff reasonable.
Testing Instructions
npm run lint:jsshould pass.Use of AI Tools
Manually revised lint rule changes. Used Cursor IDE + Composer model to add missing
package.jsondependencies based on failure report. Reviewed changes manually for consistency, and edited manually in some cases to reduce size of diff (e.g. manually downgrading@typescript-eslint/parserto avoid a nested copy).