Skip to content

Migrate to ESLint flat config (v9)#8193

Draft
eventualbuddha wants to merge 3 commits intomainfrom
brian/eslint/flat-config
Draft

Migrate to ESLint flat config (v9)#8193
eventualbuddha wants to merge 3 commits intomainfrom
brian/eslint/flat-config

Conversation

@eventualbuddha
Copy link
Copy Markdown
Contributor

Overview

Generated with Claude Code

  • Upgrade ESLint 8 → 9, @typescript-eslint 6 → 8, and related plugins
    to support ESLint's flat config format.
  • Rewrite eslint-plugin-vx to export flat config arrays (recommended,
    react, ignores) instead of legacy eslintrc objects. Uses FlatCompat
    from @eslint/eslintrc to wrap airbnb configs that lack native flat
    config support.
  • Replace all 53 workspace .eslintrc.json + .eslintignore files with
    eslint.config.mjs, consolidating common ignore patterns into shared
    presets baked into the plugin.
  • Fix ~20 source files for @typescript-eslint v8 compatibility (stricter
    no-unnecessary-type-assertion, removed ban-types rule, renamed
    no-constant-condition, etc.).

Demo Video or Screenshot

# pnpm lint works (backend example)
$ cd libs/basics && pnpm lint
# ✓ type-check, ✓ eslint

# pnpm lint works (frontend example)
$ cd apps/mark/frontend && pnpm lint
# ✓ type-check, ✓ eslint, ✓ stylelint

# git commit hooks work (lint-staged + prettier + eslint --fix)
$ git commit ...
# ✓ lint-staged passes

# neovim LSP attaches both vtsls and eslint servers
$ nvim --headless src/app.tsx  # → eslint server running, reports diagnostics

Testing Plan

  • Verified zero lint regressions across 13 representative packages by
    comparing npx eslint --no-cache src/ output against the clean
    ~/code/vxsuite repo on main.
  • All 473 eslint-plugin-vx unit tests pass.
  • Tested pnpm lint, git commit hooks (lint-staged), and headless neovim
    ESLint LSP.
  • CI will be the definitive check across all packages.

Checklist

  • I have prefixed my PR title with "VxDesign: ", "VxPollBook: ", or "HWTA: " if my change is specific to one of those products.
  • I have added logging where appropriate for any new user actions.
  • I have added the "user-facing-change" label to this PR, if relevant, to automate an announcement in #machine-product-updates.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the monorepo to ESLint v9’s flat config format by updating core ESLint/@typescript-eslint dependencies, refactoring eslint-plugin-vx to export flat-config presets, and replacing per-package legacy .eslintrc.json/.eslintignore with eslint.config.mjs.

Changes:

  • Upgrade ESLint tooling (ESLint 9, @eslint/js, @eslint/eslintrc, typescript-eslint, updated plugins).
  • Refactor eslint-plugin-vx to export flat config arrays (recommended, react, ignores) and update custom rules for ESLint v9 APIs.
  • Add eslint.config.mjs across packages and remove legacy .eslintrc.json / .eslintignore; apply targeted code tweaks for new lint rules.

Reviewed changes

Copilot reviewed 219 out of 220 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Bump root ESLint/tooling dependencies for ESLint v9 + flat config support.
libs/utils/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset + local rule overrides.
libs/utils/.eslintrc.json Remove legacy ESLint config.
libs/utils/.eslintignore Remove legacy ignore file (handled via flat config ignores).
libs/usb-drive/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset + local rule overrides.
libs/usb-drive/.eslintrc.json Remove legacy ESLint config.
libs/usb-drive/.eslintignore Remove legacy ignore file.
libs/ui/src/virtual_keyboard/scan_panels/scan_panel_row.tsx Remove now-unneeded disable comment.
libs/ui/src/virtual_keyboard/scan_panels/scan_panel.tsx Remove now-unneeded disable comment.
libs/ui/src/virtual_keyboard/scan_panels/key_button.tsx Remove now-unneeded disable comment.
libs/ui/src/reports/tally_report_card_counts.tsx Remove now-unneeded disable comment.
libs/ui/src/reports/custom_filter_summary.test.tsx Adjust to satisfy stricter TS/ESLint rules (remove non-null assertion).
libs/ui/src/link_button.tsx Remove now-unneeded disable comment.
libs/ui/package.json Upgrade eslint-plugin-storybook to a version with flat config support.
libs/ui/eslint.config.mjs New flat config using eslint-plugin-vx react preset + storybook flat config + ignores.
libs/ui/.eslintrc.json Remove legacy ESLint config.
libs/ui/.eslintignore Remove legacy ignore file.
libs/types/src/hmpb.ts Add targeted eslint-disable for @typescript-eslint/await-thenable.
libs/types/src/election.test.ts Remove unnecessary non-null assertion in test.
libs/types/eslint.config.mjs New flat config + file-scoped override for CVR naming patterns.
libs/types/.eslintrc.json Remove legacy ESLint config.
libs/types/.eslintignore Remove legacy ignore file.
libs/test-utils/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset + local rule overrides.
libs/test-utils/.eslintrc.json Remove legacy ESLint config.
libs/test-utils/.eslintignore Remove legacy ignore file.
libs/printing/eslint.config.mjs New flat config + scripts override for no-console.
libs/printing/.eslintrc.json Remove legacy ESLint config.
libs/printing/.eslintignore Remove legacy ignore file.
libs/pdi-scanner/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset.
libs/pdi-scanner/.eslintrc.json Remove legacy ESLint config.
libs/pdi-scanner/.eslintignore Remove legacy ignore file.
libs/networking/eslint.config.mjs New flat config + local no-bitwise override.
libs/networking/.eslintrc.json Remove legacy ESLint config.
libs/networking/.eslintignore Remove legacy ignore file.
libs/monorepo-utils/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset.
libs/monorepo-utils/.eslintrc.json Remove legacy ESLint config.
libs/monorepo-utils/.eslintignore Remove legacy ignore file.
libs/message-coder/eslint.config.mjs New flat config + local no-bitwise override.
libs/message-coder/.eslintrc.json Remove legacy ESLint config.
libs/message-coder/.eslintignore Remove legacy ignore file.
libs/mark-flow-ui/package.json Upgrade eslint-plugin-storybook for flat config support.
libs/mark-flow-ui/eslint.config.mjs New flat config using eslint-plugin-vx react preset + storybook flat config + ignores.
libs/mark-flow-ui/.eslintrc.json Remove legacy ESLint config.
libs/mark-flow-ui/.eslintignore Remove legacy ignore file.
libs/logging/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset + local rule overrides.
libs/logging/.eslintrc.json Remove legacy ESLint config.
libs/logging/.eslintignore Remove legacy ignore file.
libs/logging-utils/eslint.config.mjs New flat config + ignore emitted entrypoints + local rule overrides.
libs/logging-utils/.eslintrc.json Remove legacy ESLint config.
libs/logging-utils/.eslintignore Remove legacy ignore file.
libs/image-utils/eslint.config.mjs New flat config + ignore bin + local rule overrides.
libs/image-utils/.eslintrc.json Remove legacy ESLint config.
libs/image-utils/.eslintignore Remove legacy ignore file.
libs/hmpb/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset + local rule overrides.
libs/hmpb/.eslintrc.json Remove legacy ESLint config.
libs/hmpb/.eslintignore Remove legacy ignore file.
libs/grout/test-utils/eslint.config.mjs New flat config + ignore JS build artifacts.
libs/grout/test-utils/.eslintrc.json Remove legacy ESLint config.
libs/grout/test-utils/.eslintignore Remove legacy ignore file.
libs/grout/src/grout.test.ts Add targeted eslint-disable lines for new TS-ESLint rules.
libs/grout/eslint.config.mjs New flat config + ignore JS/test-utils.
libs/grout/.eslintrc.json Remove legacy ESLint config.
libs/grout/.eslintignore Remove legacy ignore file.
libs/fujitsu-thermal-printer/eslint.config.mjs New flat config + local no-bitwise/JSDoc overrides.
libs/fujitsu-thermal-printer/.eslintrc.json Remove legacy ESLint config.
libs/fujitsu-thermal-printer/.eslintignore Remove legacy ignore file.
libs/fs/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset.
libs/fs/.eslintrc.json Remove legacy ESLint config.
libs/fs/.eslintignore Remove legacy ignore file.
libs/fixtures/eslint.config.mjs New flat config + ignore embedded fixture TS files + local rule overrides.
libs/fixtures/.eslintrc.json Remove legacy ESLint config.
libs/fixtures/.eslintignore Remove legacy ignore file.
libs/fixture-generators/eslint.config.mjs New flat config + ignore bin + CVR naming override.
libs/fixture-generators/.eslintrc.json Remove legacy ESLint config.
libs/fixture-generators/.eslintignore Remove legacy ignore file.
libs/eslint-plugin-vx/src/rules/no_react_hook_mutation_dependency.ts Update rule metadata/APIs for ESLint v9 + guard missing parser services.
libs/eslint-plugin-vx/src/rules/no_manual_sleep.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/no_import_workspace_subfolders.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/no_floating_results.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/no_expect_to_be.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/no_assert_truthiness.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/no_assert_result_predicates.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/no_array_sort_mutation.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/gts_use_optionals.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/gts_unicode_escapes.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/gts_type_parameters.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/gts_spread_like_types.ts Adjust typing around node.parent usage for stricter TS/ESLint.
libs/eslint-plugin-vx/src/rules/gts_safe_number_parse.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/gts_parameter_properties.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/gts_object_literal_types.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/gts_no_unnecessary_has_own_property_check.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/gts_no_return_type_only_generics.ts Replace removed context.getScope() usage with sourceCode.getScope(node).
libs/eslint-plugin-vx/src/rules/gts_no_public_modifier.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/gts_no_public_class_fields.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/gts_no_private_fields.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/gts_no_import_export_type.ts Add helper for specifier names + update scope lookup for ESLint v9.
libs/eslint-plugin-vx/src/rules/gts_no_foreach.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/gts_no_for_in_loop.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/gts_no_default_exports.ts Update scope lookup + handle non-Identifier exports in stricter AST typing.
libs/eslint-plugin-vx/src/rules/gts_no_const_enum.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/gts_no_array_constructor.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/gts_module_snake_case.ts Update getFilename usage for ESLint v9.
libs/eslint-plugin-vx/src/rules/gts_jsdoc.ts Update getScope usage for ESLint v9.
libs/eslint-plugin-vx/src/rules/gts_identifiers.ts Update getScope usage + adjust visitor signature typing.
libs/eslint-plugin-vx/src/rules/gts_func_style.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/rules/gts_direct_module_export_access_only.ts Update getScope usage for ESLint v9.
libs/eslint-plugin-vx/src/rules/gts_constants.ts Update rule metadata for new tooling.
libs/eslint-plugin-vx/src/rules/gts_array_type_style.ts Update to ESLint v9 context.sourceCode API.
libs/eslint-plugin-vx/src/index.ts Export flat-config presets (recommended, react, ignores) and default plugin object.
libs/eslint-plugin-vx/src/configs/recommended.ts Implement recommended preset as flat-config array (FlatCompat + TS/Prettier integration).
libs/eslint-plugin-vx/src/configs/react.ts Implement react preset as flat-config array layered on recommended + FlatCompat airbnb/react.
libs/eslint-plugin-vx/package.json Add exports map + update dependencies for ESLint v9/flat config and updated plugins.
libs/eslint-plugin-vx/.eslintignore Remove legacy ignore file.
libs/dev-dock/frontend/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset + local overrides.
libs/dev-dock/frontend/.eslintrc.json Remove legacy ESLint config.
libs/dev-dock/frontend/.eslintignore Remove legacy ignore file.
libs/dev-dock/backend/eslint.config.mjs New flat config using eslint-plugin-vx recommended preset + local overrides.
libs/dev-dock/backend/.eslintrc.json Remove legacy ESLint config.
libs/dev-dock/backend/.eslintignore Remove legacy ignore file.
libs/db/eslint.config.mjs New flat config + ignore bin artifacts.
libs/db/.eslintrc.json Remove legacy ESLint config.
libs/db/.eslintignore Remove legacy ignore file.
libs/custom-paper-handler/eslint.config.mjs New flat config + local no-bitwise/JSDoc overrides.
libs/custom-paper-handler/.eslintrc.json Remove legacy ESLint config.
libs/custom-paper-handler/.eslintignore Remove legacy ignore file.
libs/cdf-schema-builder/eslint.config.mjs New flat config + test-only identifier exceptions.
libs/cdf-schema-builder/.eslintrc.json Remove legacy ESLint config.
libs/cdf-schema-builder/.eslintignore Remove legacy ignore file.
libs/bmd-ballot-fixtures/eslint.config.mjs New flat config using react preset + frontend ignores.
libs/bmd-ballot-fixtures/.eslintrc.json Remove legacy ESLint config.
libs/bmd-ballot-fixtures/.eslintignore Remove legacy ignore file.
libs/basics/src/iterators/iter.test.ts Fix async iteration usage to match API (.async()).
libs/basics/eslint.config.mjs New flat config + local rule override.
libs/basics/.eslintrc.json Remove legacy ESLint config.
libs/basics/.eslintignore Remove legacy ignore file.
libs/ballot-interpreter/eslint.config.mjs New flat config using recommended preset + local overrides.
libs/ballot-interpreter/.eslintrc.json Remove legacy ESLint config.
libs/ballot-interpreter/.eslintignore Remove legacy ignore file.
libs/ballot-encoder/eslint.config.mjs New flat config + local no-bitwise override.
libs/ballot-encoder/.eslintrc.json Remove legacy ESLint config.
libs/ballot-encoder/.eslintignore Remove legacy ignore file.
libs/backend/src/cast_vote_records/build_cast_vote_record.test.ts Remove non-null assertions / adjust test values for stricter linting.
libs/backend/eslint.config.mjs New flat config + CVR naming overrides.
libs/backend/.eslintrc.json Remove legacy ESLint config.
libs/backend/.eslintignore Remove legacy ignore file.
libs/auth/eslint.config.mjs New flat config + ignore JS outputs + scripts override for no-console.
libs/auth/.eslintrc.json Remove legacy ESLint config.
libs/auth/.eslintignore Remove legacy ignore file.
docs/exercises/eslint.config.mjs New flat config for exercises with relaxed rules.
docs/exercises/.eslintrc.json Remove legacy ESLint config.
docs/exercises/.eslintignore Remove legacy ignore file.
apps/scan/frontend/eslint.config.mjs New flat config using react preset + frontend ignores.
apps/scan/frontend/.eslintrc.json Remove legacy ESLint config.
apps/scan/frontend/.eslintignore Remove legacy ignore file.
apps/scan/backend/src/electrical_testing/tasks/print_and_scan_task.ts Remove disable comment around infinite loop.
apps/scan/backend/src/electrical_testing/tasks/card_read_and_usb_drive_write_task.ts Remove disable comment around infinite loop.
apps/scan/backend/src/app_export.test.ts Remove unnecessary non-null assertion in test.
apps/scan/backend/eslint.config.mjs New flat config + local overrides + scripts no-console override.
apps/scan/backend/.eslintrc.json Remove legacy ESLint config.
apps/scan/backend/.eslintignore Remove legacy ignore file.
apps/print/frontend/eslint.config.mjs New flat config using react preset + frontend ignores.
apps/print/frontend/.eslintrc.json Remove legacy ESLint config.
apps/print/frontend/.eslintignore Remove legacy ignore file.
apps/print/backend/eslint.config.mjs New flat config using recommended preset + ignores/scripts handling.
apps/print/backend/.eslintrc.json Remove legacy ESLint config.
apps/print/backend/.eslintignore Remove legacy ignore file.
apps/pollbook/frontend/eslint.config.mjs New flat config using react preset + frontend ignores.
apps/pollbook/frontend/.eslintrc.json Remove legacy ESLint config.
apps/pollbook/frontend/.eslintignore Remove legacy ignore file.
apps/pollbook/backend/eslint.config.mjs New flat config using recommended preset + scripts ignored.
apps/pollbook/backend/.eslintrc.json Remove legacy ESLint config.
apps/pollbook/backend/.eslintignore Remove legacy ignore file.
apps/mark/integration-testing/eslint.config.mjs New flat config for playwright projects + targeted overrides.
apps/mark/integration-testing/.eslintrc.json Remove legacy ESLint config.
apps/mark/integration-testing/.eslintignore Remove legacy ignore file.
apps/mark/frontend/eslint.config.mjs New flat config using react preset + frontend ignores (+ codemods/scripts ignores).
apps/mark/frontend/.eslintrc.json Remove legacy ESLint config.
apps/mark/frontend/.eslintignore Remove legacy ignore file.
apps/mark/backend/src/electrical_testing/background.ts Remove disable comments around infinite loops.
apps/mark/backend/eslint.config.mjs New flat config using recommended preset + vendor ignores.
apps/mark/backend/.eslintrc.json Remove legacy ESLint config.
apps/mark/backend/.eslintignore Remove legacy ignore file.
apps/mark-scan/integration-testing/eslint.config.mjs New flat config for playwright projects + targeted overrides.
apps/mark-scan/integration-testing/.eslintrc.json Remove legacy ESLint config.
apps/mark-scan/integration-testing/.eslintignore Remove legacy ignore file.
apps/mark-scan/frontend/eslint.config.mjs New flat config using react preset + frontend ignores (+ codemods/scripts ignores).
apps/mark-scan/frontend/.eslintrc.json Remove legacy ESLint config.
apps/mark-scan/frontend/.eslintignore Remove legacy ignore file.
apps/mark-scan/backend/eslint.config.mjs New flat config using recommended preset + vendor ignores.
apps/mark-scan/backend/.eslintrc.json Remove legacy ESLint config.
apps/mark-scan/backend/.eslintignore Remove legacy ignore file.
apps/design/frontend/src/routes.ts Remove legacy disable for removed rule (ban-types).
apps/design/frontend/eslint.config.mjs New flat config using react preset + frontend ignores.
apps/design/frontend/.eslintrc.json Remove legacy ESLint config.
apps/design/frontend/.eslintignore Remove legacy ignore file.
apps/design/backend/src/file_storage_client.test.ts Remove non-null assertion in test access.
apps/design/backend/eslint.config.mjs New flat config + scripts override + migrations override.
apps/design/backend/.eslintrc.json Remove legacy ESLint config.
apps/design/backend/.eslintignore Remove legacy ignore file.
apps/central-scan/integration-testing/eslint.config.mjs New flat config for playwright projects + targeted overrides.
apps/central-scan/integration-testing/.eslintrc.json Remove legacy ESLint config.
apps/central-scan/integration-testing/.eslintignore Remove legacy ignore file.
apps/central-scan/frontend/eslint.config.mjs New flat config using react preset + additional local identifier exceptions.
apps/central-scan/frontend/.eslintrc.json Remove legacy ESLint config.
apps/central-scan/frontend/.eslintignore Remove legacy ignore file.
apps/central-scan/backend/eslint.config.mjs New flat config + scripts override + vendor ignores.
apps/central-scan/backend/.eslintrc.json Remove legacy ESLint config.
apps/central-scan/backend/.eslintignore Remove legacy ignore file.
apps/admin/integration-testing/eslint.config.mjs New flat config for playwright projects + targeted overrides.
apps/admin/integration-testing/.eslintrc.json Remove legacy ESLint config.
apps/admin/integration-testing/.eslintignore Remove legacy ignore file.
apps/admin/frontend/src/utils/reporting.test.ts Remove unnecessary non-null assertions in test.
apps/admin/frontend/src/screens/settings_screen.test.tsx Update disable comment to match new rule set.
apps/admin/frontend/eslint.config.mjs New flat config using react preset + frontend ignores.
apps/admin/frontend/.eslintrc.json Remove legacy ESLint config.
apps/admin/frontend/.eslintignore Remove legacy ignore file.
apps/admin/backend/eslint.config.mjs New flat config + CVR identifier exception + test overrides.
apps/admin/backend/.eslintrc.json Remove legacy ESLint config.
apps/admin/backend/.eslintignore Remove legacy ignore file.
Comments suppressed due to low confidence (4)

apps/scan/backend/src/electrical_testing/tasks/print_and_scan_task.ts:173

  • This while (true) loop previously suppressed no-constant-condition. The new flat config includes eslint:recommended (via @eslint/js), which enables no-constant-condition, so this will likely start failing lint. Consider switching to for (;;) {} or restoring the rule suppression with a brief justification.
    apps/scan/backend/src/electrical_testing/tasks/card_read_and_usb_drive_write_task.ts:36
  • This while (true) loop previously suppressed no-constant-condition. With the new flat config pulling in eslint:recommended, no-constant-condition will be enabled again and this loop is likely to fail lint. Consider using for (;;) {} or adding back an eslint-disable-next-line no-constant-condition with an explanation.
    apps/mark/backend/src/electrical_testing/background.ts:50
  • This while (true) loop used to suppress no-constant-condition. Since the new ESLint v9 flat config includes eslint:recommended, no-constant-condition will be active and this will likely fail lint. Consider rewriting as for (;;) {} or restoring the suppression with a justification.
    apps/mark/backend/src/electrical_testing/background.ts:156
  • This while (true) loop used to suppress no-constant-condition. With the new flat config enabling eslint:recommended, this will likely trigger no-constant-condition again. Consider using for (;;) {} or restoring a targeted suppression comment.

Comment on lines +1 to +3
import { recommended } from 'eslint-plugin-vx';

export default [...recommended];
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint.config.mjs opts this package into flat config, but @votingworks/monorepo-utils still pins eslint@8.57.0 in its package.json. Running pnpm lint from this package directory is likely to invoke ESLint 8 (which won’t use flat config by default), so linting may silently stop working or behave differently. Update this package to use ESLint 9 (or remove the package-local ESLint dependency so it resolves the workspace version) to keep the migration consistent.

Copilot uses AI. Check for mistakes.
Comment on lines +222 to 226
// Prettier must come last to turn off conflicting style rules.
eslintConfigPrettier,

// ── Test file overrides ───────────────────────────────────────
{
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint-config-prettier is added before the test/storybook override config blocks, but the comment says it “must come last”. In flat config, later configs win, so putting Prettier before overrides risks re-enabling formatting-related rules in those overrides. Move the Prettier config object to the end of the returned array (after all files overrides) to guarantee it disables conflicting rules consistently.

Copilot uses AI. Check for mistakes.
Comment on lines +140 to 143
'@typescript-eslint/no-unused-vars': [
'error',
{ caughtErrors: 'none' },
],
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@typescript-eslint/no-unused-vars is now configured with { caughtErrors: 'none' }, which is a behavior change from the prior config (unused catch (err) bindings will no longer be reported). If the intent of this PR is to keep lint behavior stable during the ESLint v9/flat-config migration, consider removing this option (or setting it to the previous behavior) and fixing any newly-reported unused catch bindings instead.

Copilot uses AI. Check for mistakes.
@eventualbuddha eventualbuddha force-pushed the brian/eslint/flat-config branch 8 times, most recently from 2a098fc to eeed07a Compare March 27, 2026 20:54
eventualbuddha and others added 3 commits March 27, 2026 14:06
Upgrade ESLint 8→9, @typescript-eslint 6→8, and related plugins.
Rewrite the custom eslint-plugin-vx to export flat config arrays
(`recommended`, `react`, `ignores`) instead of legacy eslintrc objects.
Use FlatCompat from @eslint/eslintrc to wrap airbnb configs that lack
native flat config support.

Key dependency changes:
- eslint: 8.57.0 → 9.x
- @typescript-eslint/utils: 6.7.0 → 8.x
- typescript-eslint: added v8 (unified package)
- eslint-plugin-import: 2.27.5 → 2.32.0 (ESLint v9 compat)
- eslint-plugin-react-hooks: added v5
- eslint-plugin-storybook: 0.6.10 → 0.11.x
- eslint-config-prettier: 9.x → 10.x

Plugin rule fixes for ESLint v9 / typescript-eslint v8:
- Replace context.getScope() → context.sourceCode.getScope(node)
- Replace context.getSourceCode() → context.sourceCode
- Replace context.getFilename() → context.filename
- Remove deprecated meta.docs.recommended / requiresTypeChecking
- Fix AST type changes (Identifier | StringLiteral unions)

New v8 rules disabled to preserve existing behavior:
- @typescript-eslint/no-require-imports (require() used intentionally)
- @typescript-eslint/no-empty-object-type (interface-from-Zod pattern)
- no-undef, no-unused-vars, no-redeclare (TypeScript handles these)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert all 53 workspace packages from legacy eslintrc format to ESLint
flat config. Each package now has an eslint.config.mjs that imports
`recommended` or `react` config arrays from eslint-plugin-vx.

Common ignore patterns are consolidated:
- Universal ignores (build, coverage, *.config.*, .*rc*.js, *.d.ts) are
  baked into the plugin's config arrays.
- `ignores.frontend` and `ignores.integrationTesting` presets cover
  additional patterns shared by those package types.
- Only truly package-specific patterns remain inline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address stricter rules and removed rules in @typescript-eslint v8:

- Remove unnecessary type assertions detected by stricter
  `no-unnecessary-type-assertion` (auto-fixed)
- Remove stale eslint-disable comments for rules renamed or removed in
  v8: `no-constant-condition`, `@typescript-eslint/no-var-requires`,
  `@typescript-eslint/ban-types`, `react/display-name`,
  `react/no-array-index-key` (auto-fixed)
- Fix `for await` on sync iterable in iter.test.ts (use `.async()`)
- Add targeted eslint-disable comments in grout.test.ts for type-level
  test expressions and hmpb.ts for a Promise.all with union-typed values

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@eventualbuddha eventualbuddha force-pushed the brian/eslint/flat-config branch from eeed07a to 0b75953 Compare March 27, 2026 21:14
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.

2 participants