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.
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.
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 aconfigArrayFindFiles()
equivalent eventually, but we need to start somewhere.The way that
configArrayFindFiles()
is constructed it could also simplify ESLint'sglobSearch()
as well if it were to be upstreamed to@eslint/config-array
, as it would separate the concerns of matching byConfigArray
files and ignores and matching by the globs sent intoglobSearch()
when someone wants to lint a set of files.