getRulesListFromConfigs static method

Iterable<UseDesignSystemItem> getRulesListFromConfigs(
  1. CustomLintConfigs configs
)

Implementation

static Iterable<UseDesignSystemItem> getRulesListFromConfigs(
  CustomLintConfigs configs,
) {
  final config = UseDesignSystemItemConfig.fromConfig(
    configs.rules[ruleName]?.json ?? {},
  );

  return config.replacements.entries.map(
    (entry) => UseDesignSystemItem(
      preferredItemName: entry.key,
      replacements: entry.value,
    ),
  );
}