Organize types and interfaces in intuitive namespace hierarchies and use specific types instead of generic ones. Types should be accessible through logically related namespaces, and method signatures should accurately reflect their parameters and return values. This improves code clarity, discoverability, and type safety.
Organize types and interfaces in intuitive namespace hierarchies and use specific types instead of generic ones. Types should be accessible through logically related namespaces, and method signatures should accurately reflect their parameters and return values. This improves code clarity, discoverability, and type safety.
// Prefer this (specific types, logical organization)
const converter: Converter = DynamoDB.Converter;
function resolvePromise(): Promise<Credentials> { /* ... */ }
// Instead of these (generic types, unintuitive organization)
const converter: any = DynamoDB.Converter;
const options: DynamoDB.DocumentClient.ConverterOptions = { /* ... */ }; // accessing through DocumentClient when logically belongs to Converter
function resolvePromise(): Promise<any> { /* ... */ }
Enter the URL of a public GitHub repository