Closed mdjermanovic closed 1 week ago
Similar to #66 it would be nice if some parts of eslint
and/or @eslint/config-array
could be reused here.
Essentially, this could be replaced by an exposed findFiles()
:
And if the matching and ignoring logic of getConfigWithStatus()
in @eslint/config-array
could be broken out prior to the merging of all configs and decorated with whether the inclusion is explicit or implicit, then the UI could also distinguish between what's explicitly matched and what's implicitly matched (the ones having no files
or only matching a /*
or /**
pattern)
Reusing findFiles()
would probably fix #63 as well
Originally reported in https://github.com/eslint/eslint/issues/18475.
With this config:
for a file named
fail.txt
, config-inspector reports that it is matched by 1 config item (the one in eslint.config.js).Which is true, this config item does match this file, but files not matched by at least one config object with a pattern that doesn't end with
/*
or/**
are effectively ignored as "unconfigured". So for this file, it would make more sense to report it as "not included or has been ignored".Repro: https://stackblitz.com/edit/stackblitz-starters-99hktx
Flat config's matching & ignoring logic is here:
https://github.com/eslint/rewrite/blob/830424fd10f0dfe88ee4b1a14b74095db7654476/packages/config-array/src/config-array.js#L838-L1009