Files
lucide/tools/build-icons/utils/deprecationReasonTemplate.ts
Karsa 0f7ac1f988 fix(scripts): removed toBeRemovedInVersion from all scripts and tools (#4674)
* fix(scripts): remove toBeRemovedInVersion from all scripts and tools

* fix(scripts): fixed linting
2026-08-06 14:28:58 +02:00

25 lines
910 B
TypeScript

import type { AliasDeprecationReason, IconDeprecationReason } from '../types.ts';
export default function deprecationReasonTemplate(
deprecationReason: AliasDeprecationReason | IconDeprecationReason,
{
componentName,
}: {
componentName: string;
iconName: string;
},
) {
const resourceName = deprecationReason.startsWith('icon') ? 'icon' : 'alias';
switch (deprecationReason) {
case 'alias.typo':
return `Renamed because of typo, use {@link ${componentName}} instead.`;
case 'alias.duplicate':
return `The icon was combined with another icon that shares the same use case, use {@link ${componentName}} instead.`;
case 'alias.name':
return `The name of this icon was changed because it didn't meet our guidelines anymore, use {@link ${componentName}} instead.`;
default:
throw new Error(`Unknown deprecation reason: ${deprecationReason}`);
}
}