Follow-up to #73396 and this review comment on #81037.
What problem does this address?
We decided to stop using External dependencies, WordPress dependencies, and Internal dependencies comment blocks, but the migration is incomplete.
Earlier work stopped requiring the comments (#73616), added a lint option to forbid them (#74990), and removed them from a few packages (#78573). However:
- About 9,540 dependency comment blocks remain in 5,510 files.
- The coding guidelines still tell contributors to add them.
- Only
design-system-mcp, ui, and theme prevent them from being reintroduced.
- Blank lines between import groups are allowed.
- Staged linting does not cover
.mjs or .cjs files.
The desired result is one contiguous import block, with no dependency group comments or blank lines between imports. This does not add alphabetization or otherwise change the existing import ordering policy.
For this behavior, the relevant import/order option is newlines-between: "never". newlines-between-types only applies to type-only import groups.
Proposed plan
-
Remove the outdated guidance
- Stop telling contributors to add dependency group comments.
-
Define the final lint rules
- Harden and test the existing
dependency-group rule's "never" mode.
- Forbid dependency comments and import blank lines in the base ESLint configuration.
- Cover
*.{js,jsx,ts,tsx,mjs,cjs} files.
- Preserve meaningful comments and side-effect import order.
-
Replace the strict configuration with bulk suppressions
- Remove the separate strict ESLint configuration.
- Run ESLint with
--fix first so safely fixable violations are not suppressed.
- Bulk-suppress remaining legacy violations.
- Use the existing CI pruning workflow to keep the suppression file current.
-
Remove the legacy violations
- Fix suppressed violations in reviewable batches.
- Prune the corresponding suppressions as each batch lands.
- Add mechanical cleanup commits to
.git-blame-ignore-revs.
Done when
- Dependency group comments remain only in lint-rule fixtures.
- Imports have no blank lines between them.
- The base ESLint configuration and CI enforce both rules for all supported files.
- The strict ESLint configuration has been removed.
- Documentation matches the enforced convention.
- No related bulk suppressions remain.
Follow-up to #73396 and this review comment on #81037.
What problem does this address?
We decided to stop using
External dependencies,WordPress dependencies, andInternal dependenciescomment blocks, but the migration is incomplete.Earlier work stopped requiring the comments (#73616), added a lint option to forbid them (#74990), and removed them from a few packages (#78573). However:
design-system-mcp,ui, andthemeprevent them from being reintroduced..mjsor.cjsfiles.The desired result is one contiguous import block, with no dependency group comments or blank lines between imports. This does not add alphabetization or otherwise change the existing import ordering policy.
For this behavior, the relevant
import/orderoption isnewlines-between: "never".newlines-between-typesonly applies to type-only import groups.Proposed plan
Remove the outdated guidance
Define the final lint rules
dependency-grouprule's"never"mode.*.{js,jsx,ts,tsx,mjs,cjs}files.Replace the strict configuration with bulk suppressions
--fixfirst so safely fixable violations are not suppressed.Remove the legacy violations
.git-blame-ignore-revs.Done when