Skip to content

Bug: config-helpers lacks a dependency on eslint required by exported types #226

Open
@kirkwaiblinger

Description

@kirkwaiblinger

Which packages are affected?

  • @eslint/compat
  • @eslint/config-array
  • @eslint/config-helpers
  • @eslint/core
  • @eslint/mcp
  • @eslint/migrate-config
  • @eslint/object-schema
  • @eslint/plugin-kit

Environment

See https://github.com/kirkwaiblinger/eslint-config-helpers-missing-eslint-dep

What did you do?

Attempted to use @eslint/config-helpers in TS code without eslint@9 also present.

What did you expect to happen?

Types exported by @eslint/config-helpers should be usable without requiring undeclared dependencies to be installed.

What actually happened?

Types exported by @eslint/config-helpers are erroneous if eslint@9 is not present.

Link to Minimal Reproducible Example

https://github.com/kirkwaiblinger/eslint-config-helpers-missing-eslint-dep

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

Essentially, @eslint/config-helpers has a type-level dependency on eslint, but it doesn't declare it as a dependency in package.json. This means that the exported type don't work without eslint being installed, and they're also broken if a version of eslint other than 9 is installed. I think that a peer dependency with appropriate dependency range is likely the solution. I'm not quite sure whether a peer dep is the solution, or whether the types need to be split off into a separate package in order to avoid circular dependencies or something.

This is a hindrance for making progress on typescript-eslint/typescript-eslint#11190, a pre-requisite for typescript-eslint/typescript-eslint#10935

Metadata

Metadata

Assignees

Labels

acceptedbugSomething isn't workingrepro:yesIssues with a reproducible example

Type

No type

Projects

Status

Ready to Implement

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions