Configuration

The configuration file for the CLI can be placed in the following locations:

  • An omlet property in the package.json file.

  • An .omletrc file in JSON or YAML format in the root directory of your repository

  • An .omletrc.json, .omletrc.yaml, .omletrc.yml, or .omletrc.js file in the root directory of your repository

Alternatively, you can also specify a custom configuration file name and location using the --config option in the CLI command:

npx @omlet/cli analyze --config './path/file'

Properties

The configuration file can include the following properties:

Filenames or glob patterns that will be included in the scan.

{
  "include": string[]
}

Filenames or glob patterns that will be excluded from the scan.

{
    "ignore": string[]
}

Custom alias configurations.

"aliases": {
    [name: string]: string[]
}

Corresponding entry points of packages.

"exports": {
    [name: string]: string[]
}

Package-specific configurations if you have a monorepo.

"workspaces": {
  [packageName: string]: {
    "aliases": {
      [name: string]: string[]
    }
  }
}

Path to your tsconfig file.

"tsconfigPath": string

include, ignore, and tsconfigPath properties can be set using either command-line arguments or the configuration file. If a property is provided as a command-line argument, the corresponding value in the configuration file will be ignored. A default value will be used if a property is not set via the configuration file or command-line argument.

Last updated