Skip to content

Swap lint to ESLint 10 on a flat config #336

Closed

Description

@jtklein-agents

Parent

#333 (Spec: move lint to ESLint 10 on a flat config). Second of two tickets; #335 lands the hand fixes first.

What to build

yarn lint runs ESLint 10 from one flat config, eslint.config.js, and the old .eslintrc.cjs and eslint-config-react-app are gone. The command, its arguments, the lint and lint:fix scripts and both CI workflows that call yarn lint are unchanged. The tree passes with zero warnings.

The Implementation Decisions section of #333 is the rule-by-rule source: read it for the config. The starting point is the draft on the throwaway branch prototype/eslint-flat-config. That draft predates the rule decisions, so adjust it to them; do not copy it.

  • Config shape, in this order: global ignores; base presets (@eslint/js recommended, typescript-eslint recommended and stylistic, no type-checked presets); hand-written blocks that set globals for shell main, preload, page, tests and config files; one block with the repo's style rules for every file; the hooks preset for page code; one block of TypeScript rules. The typescript-eslint parser parses every linted file. The linted file set stays as it is.

  • Dependencies: ESLint 10. Add as direct dev dependencies @eslint/js, typescript-eslint, @stylistic/eslint-plugin, eslint-plugin-import-x, eslint-plugin-react-hooks, globals. Keep eslint-plugin-lodash. Remove eslint-config-react-app, the two @typescript-eslint/* dev dependencies, and the resolutions pins on @typescript-eslint/*.

  • Rules: the kept, dropped, carried-over and switched-off lists in Spec: move lint to ESLint 10 on a flat config #333. Rule names and every reference to them become import-x/* and @stylistic/*; nothing is aliased to the old names.

  • Cycle check: import-x/no-cycle needs the plugin's TypeScript settings and a resolver that knows .ts and .tsx, or it passes while checking nothing. From the prototype:

    settings: {
      ...importX.flatConfigs.typescript.settings,
      'import-x/resolver-next': [ createNodeResolver( { extensions: [ '.ts', '.tsx', '.js', '.mjs', '.json' ] } ) ],
    },
  • Autofixes: run yarn lint:fix for the JSX indentation reports, the quote reports and the remaining small autofixable reports (prefer-const and the typescript-eslint stylistic rules).

  • Inline disable: one, with a reason, for @typescript-eslint/no-unsafe-declaration-merging at the deliberate interface and class merge in the page store's alignment module.

  • Test: one new Vitest test lints a small known-bad fixture through the real eslint.config.js in a child Node process and asserts a report for each of: a two-file TypeScript import cycle (import-x/no-cycle), a hook called outside a component (react-hooks/rules-of-hooks), a missing semicolon (@stylistic/semi), a double-quoted string (@stylistic/quotes). The fixture is linted under the page block's rules yet stays out of the yarn lint file set; how is your choice. Prior art is the source-maps test, which loads the shell build config in a child Node process. The test does not assert on the config object's contents.

  • Local doc edit: remove the sentence in the TypeScript leaves agent doc that requires explicit return types and cites explicit-module-boundary-types. That doc is excluded from git, so the edit is local and not part of the pull request.

Fallback, only on a blocker the prototype did not hit: ESLint 9 with eslint-plugin-import unchanged. Report the blocker before taking it.

Acceptance criteria

  • yarn lint runs ESLint 10 from eslint.config.js and passes with zero warnings
  • .eslintrc.cjs is deleted; eslint-config-react-app, the two @typescript-eslint/* dev dependencies and the resolutions pins on them are gone from package.json
  • Every plugin the config imports is a direct dev dependency
  • The four formatting rules run from @stylistic with today's options, and @stylistic/semi and @stylistic/quotes are on
  • The kept, dropped, carried-over and switched-off rules match Spec: move lint to ESLint 10 on a flat config #333; no rule or reference uses an import/* name
  • The new Vitest test fails when any of the four rules stops reporting on the fixture, and the fixture produces no report in yarn lint
  • Autofix changes are whitespace and quotes plus the small autofixable reports; the only hand edit to production code is the one inline disable
  • The lint and lint:fix scripts and the CI workflows are unchanged
  • The Vitest suite and yarn typecheck:baseline pass
  • The explicit-return-types sentence is removed from the local TypeScript leaves agent doc

Activity

  1. added
    ready-for-agent
    on Nov 23, 2026
  2. jtklein-agents commented on Nov 23, 2026

    @jtklein-agents
    OwnerAuthor

    Merged in #339 into spec/333-eslint-10-flat-config. CI green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions