Skip to content

Change Request: Export default config #18619

@voxpelli

Description

@voxpelli

ESLint version

9.5.0

What problem do you want to solve?

Eg. the @eslint/config-inspector needs to duplicate the ESLint default config as well as configuration resolution logic and file matching logic, leading to potential mismatches – see eg eslint/config-inspector#66 and eslint/config-inspector#59

I can imagine that similar tools, such as my compare-eslint-configs will have similar challenges when they start to support flat configs

What do you think is the correct solution?

I would want these to be exposed:

The calculateConfigArray enables one to get a properly configured FlatConfigArray for a project, including default values, solving eslint/config-inspector#66 for good.

The findFiles then enables one to properly find all matching files for that config, avoiding most of eslint/config-inspector#59 and eslint/config-inspector#63 – where the correct files are matched and the correct files are ignored.

Participation

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

Additional comments

Since these are API:s for tools like @eslint/config-inspector and compare-eslint-configs they are not core to the functionality of ESLint itself and hence I think unsupported-api.js is the correct place for them.

Metadata

Metadata

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusioncoreRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLint

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions