unified-engine
accepts patterns to ignore when searching for files to
process through ignore files.
One ignore file can be given through ignorePath
, this is loaded
regardless of detectIgnore
and ignoreName
.
Otherwise, ignore files are detected if detectIgnore
is
turned on and ignoreName
is given.
The first file named ignoreName
in the parent directory of a checked path is
used.
Or, if no file is found, the parent directory if searched, and so on.
In addition to explicit and implicit ignore files, other patterns can be given
with ignorePatterns
.
The format of each pattern in ignorePattern
is the same as a line in an ignore
file.
Patterns and files are resolved based on the current working directory.
It is also possible to ignore files that do not have an associated detected
configuration file by turning on ignoreUnconfigured
.
Ignoring is used when searching for files in directories.
If paths (including those expanded from globs) are passed in that are ignored,
an error is thrown.
These files can be silently ignored by turning on
silentlyIgnore
.
Normally, files are ignored based on the path of the found ignore file and the
patterns inside it.
Patterns passed with ignorePatterns
are resolved based on
the current working directory.
Patterns in ignorePath
can be resolved from the current working
directory instead, by setting
ignorePathResolveFrom
to cwd
instead of dir
(default).
If paths or globs to directories are given to the engine, they will be searched
for matching files, but node_modules
and hidden directories (those starting
with a dot, .
, such as .git
) are normally not searched.
Pass paths or globs to files or those directories to include files inside
node_modules
and hidden directories.
The format for ignore files is the same as .gitignore
, so it’s
possible to pass a .gitignore
in as ignorePath
.
node-ignore
is used under the hood, see its documentation
for more information.
An example ignore file could look as follows:
# Duo dependencies.
components
# Fixtures.
test/{input,tree}