Skip to content

chore(lint): clean up pre-existing ESLint errors exposed by PR #1208 #1210

Description

@danieliser

Context

PR #1208 caused `lint:js:changed` to run over a much wider set of files than any recent PR has, exposing pre-existing ESLint errors that weren't introduced by #1208 — they were simply not being checked before because nobody had touched those files recently.

Two categories of pre-existing errors were unblocked in #1208:

1. `import/no-unresolved` on `@popup-maker/*` workspace packages

Workaround applied: Added `^@popup-maker/` to the `ignore` list in `.eslintrc.js`. This silences the rule but doesn't actually fix the underlying resolver issue.

Root cause: `eslint-plugin-import`'s default resolver can't follow pnpm workspace symlinks in CI's strict install layout, even though the imports work correctly at runtime (via tsconfig paths + webpack aliases).

Proper fix: Add `eslint-import-resolver-typescript` or equivalent that reads `tsconfig.json` paths, then remove the workaround ignore entry.

2. `@wordpress/i18n-translator-comments` placeholder format

Several pre-existing `sprintf()` / `_n()` calls used legacy comment formats:

  • `// translators: 1. number of items` (numbered format)
  • `// translators: 1. call to action label` (wrong description for actual `%d`)
  • Missing translator comments entirely

Fixed in #1208 for touched files only. Similar errors likely exist in other files that weren't part of that PR's diff.

What's needed

  1. Proper ESLint resolver config so `@popup-maker/*` imports resolve without an ignore list.
  2. Audit all `sprintf`/`_n`/`_x` call sites in `packages/` and `assets/js/src/` for translator comment compliance.
  3. Optional: configure `lint:js` to run repo-wide in CI (not just changed files) so these don't accumulate.

Acceptance

  • `\^@popup-maker/\ removed from \import/no-unresolved` ignore list
  • Full-repo `pnpm run lint:js` passes
  • Translator comments consistent across all localized strings

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions