Skip to main content

types-kit-config

Build npm version

TypeScript type definitions for rnx-kit configuration, dependency alignment, and lint rules. This package exists to break circular dependencies between rnx-kit packages that share these types.

Installation

yarn add @rnx-kit/types-kit-config --dev

or if you're using npm

npm add --save-dev @rnx-kit/types-kit-config

Usage

import type {
KitConfig,
AlignDepsConfig,
Capability,
} from "@rnx-kit/types-kit-config";

Types

Configuration Types

KitConfig

Configuration for an rnx-kit package, stored in the rnx-kit field of package.json.

NameTypeDescription
extendsstring | undefinedLoad base config from file or module.
kitTypeKitType | undefinedWhether this kit is an "app" or a "library". Defaults to "library".
alignDepsAlignDepsConfig | undefinedConfigures how align-deps should align dependencies for this package.
bundleBundleConfig | BundleConfig[] | undefinedSpecifies how the package is bundled.
serverServerConfig | undefinedSpecifies how the package's bundle server is configured.
lintobject | undefinedConfigures rnx-kit linting tools and their rules.

KitType

type KitType = "app" | "library";

DependencyVersions

A record mapping package names to version strings.

GetDependencyVersions

A function returning a DependencyVersions record.

Dependency Alignment Types

AlignDepsConfig

Configuration for the align-deps dependency alignment tool.

NameTypeDescription
presetsstring[] | undefinedPresets to use for aligning dependencies.
requirementsstring[] | { development: string[]; production: string[] }Requirements for this package, e.g. react-native@>=0.66.
capabilitiesCapability[] | undefinedCapabilities used by the kit.

Capability

Well-known capability names used by align-deps for dependency management. Includes platform cores (core, core-android, core-ios, etc.), Metro tooling (metro, metro-config), navigation (navigation/native, navigation/stack), and many common React Native libraries.

MetaCapability

Meta-capabilities that aggregate other capabilities (e.g. "core/testing").

Lint Rule Types

RuleBaseOptions

Base options shared by all lint rules.

NameTypeDescription
enabledboolean | undefinedWhether to enable this rule. Defaults to true.

NoDuplicatesRuleOptions

Options for the no-duplicates lockfile lint rule. Extends RuleBaseOptions.

NameTypeDescription
packagesreadonly (string | readonly [string, number])[] | undefinedList of packages to check for duplicates.

NoWorkspacePackageFromNpmRuleOptions

Options for the no-workspace-package-from-npm lockfile lint rule. Extends RuleBaseOptions.