Back to all reviewers

Complete configuration type definitions

aws/aws-sdk-js
Based on 2 comments
TypeScript

Ensure configuration type definitions are complete and consistent between global and service-specific settings. When designing configuration classes, include service identifiers as optional instance variables and ensure update methods accept all relevant option types that might be used at both global and service-specific levels.

Configurations TypeScript

Reviewer Prompt

Ensure configuration type definitions are complete and consistent between global and service-specific settings. When designing configuration classes, include service identifiers as optional instance variables and ensure update methods accept all relevant option types that might be used at both global and service-specific levels.

Example:

// Proper configuration class definition
export class Config {
  // Service identifiers as optional properties
  s3?: ServiceConfigurationOptions;
  dynamodb?: ServiceConfigurationOptions;
  
  // Update method that accepts all relevant option types
  update(options: ConfigurationOptions & 
         ConfigurationServicePlaceholders & 
         APIVersions & 
         CredentialsOptions, 
         allowUnknownKeys?: boolean): void;
}

// Usage example
AWS.config.s3 = {params: {Bucket: 'myBucket'}, useDualstack: true};

This approach prevents TypeScript compiler errors when users set valid configurations and maintains consistency between global and service-specific configuration options.

2
Comments Analyzed
TypeScript
Primary Language
Configurations
Category

Source Discussions