Skip to content

build: shared eslint config mutates module-level objects #895

Open

Description

@bpowers

createConfig() in eslint.config.shared.js returns the module-level baseConfig object by reference and writes the caller's project into it, and it appends 'eslint.*.js' to the caller's ignorePatterns array in place.
If two packages' configs were ever built in one process, the last project would win for both, and each call adds another 'eslint.*.js' to the caller's array.

Why it matters

Latent only.
ESLint loads one package config per process today, and each package passes a fresh array literal, so nothing is wrong now.
It would bite silently (a package linted against another package's tsconfig) if anything composed several package configs, such as a root config or a programmatic ESLint run over the monorepo.

Fix

Build baseConfig and reactConfig inside createConfig() (or behind small factory functions), set parserOptions.project on the local object, and use [...options.ignorePatterns, 'eslint.*.js'] instead of push.
A few lines; do it with #896, which touches the same file.

Pointers

Activity

  1. added
    bug
    hygiene
    javascript
    on Jul 8, 2026
  2. added
    ci
    on Oct 12, 2026
  3. changed the title [-]build: eslint.config.shared.js mutates module-level shared objects (cross-call clobbering, fragile index lookup)[/-] [+]build: shared eslint config mutates module-level objects[/+] on Oct 12, 2026
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

    bugcihygienejavascript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions