INNER CODE UNIT · TypeScript

validateSupportedOptions

lingui/js-lingui · packages/cli/src/api/check/index.ts:44

export function validateSupportedOptions(
  check: CheckDefinition,
  options: CheckRunOptions,
) {
  checkSpecificOptions.forEach((option) => {
    if (!options[option] || getSupportedOptions(check).includes(option)) {
      return
    }

    const owner = optionOwnerByOption.get(option)

    if (!owner) {
      throw new Error(`Unsupported check option \`${option}\`.`)
    }

    throw new Error(
      `Option \`--${owner.cliOptionName}\` can only be used with the \`${owner.checkName}\` check.`,
    )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…