@voxpelli/config-array-find-files
v1.2.1
Published
A proof of concept of a generic equivalent of ESLint's globSearch() for use with ConfigArray
Downloads
407,798
Readme
@voxpelli/config-array-find-files
A proof of concept of a generic equivalent of ESLint's globSearch()
for use with ConfigArray
Usage
import { ConfigArray } from '@eslint/config-array';
import { configArrayFindFiles } from '@voxpelli/config-array-find-files';
// Ensure you have a normalized config at hand...
const configs = new ConfigArray([
{ files: ['*.js'] },
{ files: ['*.md'] },
]);
await configs.normalize();
// ...then you are ready to find some files!
const filePaths = await configArrayFindFiles({
basePath: path.join(dirname(import.meta.url), '../'),
configs,
});
API
configArrayFindFiles()
Takes a value (input
), does something configured by the config (configParam
) and returns the processed value asyncly(output
)
Syntax
configArrayFindFiles(options) => Promise<string[]>
Options
basePath
- the directory to searchconfigs
- the config array to use for determining what to ignoredeepFilter
- optional function that indicates whether the directory will be read deep or notentryFilter
- optional function that indicates whether the entry will be included to results or not
Returns
A Promise
that resolves to an array with string
file paths for all matching files