Skip to content

no-legacy-usage

Id
@azure-tools/typespec-azure-core/no-legacy-usage

Linter warning against using elements from the Legacy namespace

Types, decorators and other constructs from located under a .Legacy namespace are considered legacy and should not be used in new code. The only acceptable usage is for brownfield services which have their existing pattern grandfathered in.

  • Area: API, SDK

Indicates use of legacy patterns instead of the current standard patterns.

model Pet {
@Azure.ClientGenerator.Core.Legacy.flattenProperty
name: PetProperties;
}
model Page {
@nextLink nextLink: Azure.Core.Legacy.parameterizedNextLink<[
ListCertificateOptions.includePending
]>;
}
model Pet {
name: PetProperties;
}
model Page {
@nextLink nextLink: url;
}

Suppress only when required to match an existing API; otherwise use the standard types and templates.