eslint / config-inspector

A visual tool for inspecting and understanding your ESLint flat configs.
https://www.npmjs.com/package/@eslint/config-inspector
Apache License 2.0
518 stars 15 forks source link

fix: use `@eslint/config-array` to resolve paths #69

Closed voxpelli closed 1 week ago

voxpelli commented 1 week ago

Fixes #59

Following the discussions in https://github.com/eslint/eslint/issues/18619 I went ahead and made a proof of concept extraction of the small core logic that ESLint uses to iterate over the files of a directory, using a ConfigArray as guidance.

I published it at configArrayFindFiles() and here is a PR that makes use if it.

It uses a fake schema to load the configs into ConfigArray as there is no published official one that can be used yet (https://github.com/eslint/eslint/issues/18619#issuecomment-2183187174)

Hopefully @eslint/config-array itself will get a configArrayFindFiles() equivalent eventually, but we need to start somewhere.

The way that configArrayFindFiles() is constructed it could also simplify ESLint's globSearch() as well if it were to be upstreamed to @eslint/config-array, as it would separate the concerns of matching by ConfigArray files and ignores and matching by the globs sent into globSearch() when someone wants to lint a set of files.