Excluding certain components & files
Need to exclude certain components and files from scans?
Omlet CLI ignores certain files while scanning, such as node modules, Storybook stories, and test files. Here are the patterns ignored in scans by default:
**/node_modules/**
**/*.d.ts
**/stories/**/*
**/.storybook/**/*
**/*.stories.{jsx,tsx,js,ts}
**/*.{spec,test}.{jsx,tsx,js,ts}
**/{__test__,tests}/**/*.{jsx,tsx,js,ts}
You can define custom file names and glob patterns to ignore from scans or limit the CLI to scan certain directories and glob patterns. There are two different options you can choose to exclude components and files from scans.
Option 1: Config file
One way of ignoring certain components is to define them in the configuration file. To do this, you can create a .omletrc
file in the root directory of your repository. The CLI will automatically detect this file and apply your configuration.
Once the config file is created, you can define the ignore
property with an array of filenames or glob patterns that should be excluded from the scan.
If you need to narrow and specify where the CLI will look for components, you can define the include
property with an array of filenames or glob patterns.
Option 2: Command line arguments
Alternatively, you can add the --ignore
option to the analyze
command while scanning your repositories.
If you need to ignore multiple directories, you can pass multiple glob patterns to the CLI.
Similar to the config file, you can use -i
/ --include
option in the analyze
command to include only specific components, files, or directories.
Last updated