Skip to content

feat!: migrate ESLint 3 to ESLint 9 flat config with typescript-eslint#950

Draft
kdaviduik wants to merge 4 commits intotypescript-migration-part-4from
typescript-migration-part-5
Draft

feat!: migrate ESLint 3 to ESLint 9 flat config with typescript-eslint#950
kdaviduik wants to merge 4 commits intotypescript-migration-part-4from
typescript-migration-part-5

Conversation

@kdaviduik
Copy link
Copy Markdown
Contributor

Replaces ESLint 3.3.1 + unmaintained eslint-plugin-shopify v13 with
ESLint 9 flat config + typescript-eslint v8. This enables type-aware
linting for .ts files during the ongoing TypeScript migration.

Key decisions:

  • 22 TypeScript rules configured (12 PRD-specified + 10 additional
    safety rules including switch-exhaustiveness-check,
    prefer-nullish-coalescing, consistent-type-imports)
  • src/types/ override suppresses known any/Function debt (deferred to PR 20)
  • Test files excluded (test linting added in Phase 5)
  • src/utils/ and src/styles/ now linted (18 files previously excluded
    by .eslintignore workaround)
  • Removed redundant lint from test script (CI already runs lint separately)
  • Used fileURLToPath workaround for __dirname (Node 18 compat)

Also fixes lint violations found by expanded coverage:

  • hasOwnProperty -> Object.hasOwn() in product-set.js
  • Removed unused isObject function in merge.js
  • Removed unused element param in frame-utils.js
  • Removed unused err binding in ui.js
  • Cleaned up stale eslint-disable directives across 4 files

BREAKING CHANGE: ESLint config format changed from .eslintrc to
eslint.config.mjs. Any custom ESLint integrations must update.

@kdaviduik kdaviduik force-pushed the typescript-migration-part-5 branch 2 times, most recently from 730d840 to a9c5b43 Compare March 12, 2026 20:53
@kdaviduik kdaviduik changed the base branch from typescript-migration-part-4 to graphite-base/950 March 13, 2026 19:18
@kdaviduik kdaviduik force-pushed the typescript-migration-part-5 branch from ffe9ea0 to 1de124b Compare March 13, 2026 19:18
@kdaviduik kdaviduik changed the base branch from graphite-base/950 to enable-auto-changelog March 13, 2026 19:18
@kdaviduik kdaviduik changed the base branch from enable-auto-changelog to graphite-base/950 March 13, 2026 19:44
@kdaviduik kdaviduik force-pushed the typescript-migration-part-5 branch from 1de124b to 4296a8c Compare March 13, 2026 19:44
@kdaviduik kdaviduik changed the base branch from graphite-base/950 to typescript-migration-part-4 March 13, 2026 19:44
@kdaviduik kdaviduik force-pushed the typescript-migration-part-4 branch from 3bc6f43 to 17942a1 Compare March 14, 2026 22:53
@kdaviduik kdaviduik force-pushed the typescript-migration-part-5 branch from 4296a8c to 850f5d1 Compare March 14, 2026 22:53
@kdaviduik kdaviduik force-pushed the typescript-migration-part-4 branch from 17942a1 to 6ff31cb Compare March 15, 2026 02:23
@kdaviduik kdaviduik force-pushed the typescript-migration-part-5 branch from 850f5d1 to f3f0e73 Compare March 15, 2026 02:23
Replaces ESLint 3.3.1 + unmaintained eslint-plugin-shopify v13 with
ESLint 9 flat config + typescript-eslint v8. This enables type-aware
linting for .ts files during the ongoing TypeScript migration.

Key decisions:
- 22 TypeScript rules configured (12 PRD-specified + 10 additional
  safety rules including switch-exhaustiveness-check with
  requireDefaultForNonUnion, prefer-nullish-coalescing,
  consistent-type-imports)
- src/types/ override suppresses known any/Function debt (deferred to PR 20)
- Test files excluded (test linting added in Phase 5)
- src/utils/ and src/styles/ now linted (18 files previously excluded
  by .eslintignore workaround)
- Removed redundant lint from test script (CI already runs lint separately)
- Used fileURLToPath workaround for __dirname (Node 18 compat)

Also fixes lint violations found by expanded coverage:
- hasOwnProperty -> Object.hasOwn() in product-set.js
- Removed unused isObject function in merge.js
- Removed unused element param in frame-utils.js
- Underscore-prefixed unused err binding in ui.js
- Cleaned up stale eslint-disable directives across 4 files

Local workflow change: `pnpm test` no longer runs lint (CI runs it
separately). Run `pnpm run lint` explicitly for local lint checks.

BREAKING CHANGE: ESLint config format changed from .eslintrc to
eslint.config.mjs. Any custom ESLint integrations must update.
The previous commit inadvertently included regenerated CSS output from
pnpm run build, which modernized vendor prefixes and CSS custom properties.
Those changes belong in the browserslist PR (part-4), not this ESLint
migration PR. Reverting to the exact part-4 version.
- Remove hardcoded "22" rule count from task 5.4 (single-source-of-truth
  is eslint.config.mjs, not a prose count that goes stale)
- Update Phase 3 summary table to reflect PR 5 submission
- Replace "PR 20" reference in eslint.config.mjs comment with
  "type refinement phase" to avoid stale PR number coupling
- Remove specific "5 stale" directive count from task 5.7
  (exact count is unnecessary and was inaccurate — it was 6)
The catch binding was underscore-prefixed (_err), not removed.
@kdaviduik kdaviduik force-pushed the typescript-migration-part-5 branch from f3f0e73 to f6df438 Compare March 15, 2026 02:39
@kdaviduik kdaviduik force-pushed the typescript-migration-part-4 branch from 6ff31cb to 6b5888f Compare March 15, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant