Always document configuration options thoroughly, especially for module and service settings. For each configuration property: 1. Provide clear descriptions of what the option does
Always document configuration options thoroughly, especially for module and service settings. For each configuration property:
@default
JSDoc tag when appropriateThis prevents developers from spending hours debugging unexpected behaviors. When default values differ between contexts or cannot use @default
tags, explicitly explain the behavior in comments.
export interface CacheModuleOptions extends CacheManagerOptions {
/**
* If "true', register `CacheModule` as a global module.
* Note: This applies only at the top level CacheModuleAsyncOptions.isGlobal,
* and will be ignored in useFactory return values.
* @default false
*/
isGlobal?: boolean;
}
For optional features or configurations that aren’t enabled by default in examples, consider adding commented code with explanatory notes:
// Uncomment these lines to enable Redis adapter
// const redisIoAdapter = new RedisIoAdapter(app);
// await redisIoAdapter.connectToRedis();
// app.useWebSocketAdapter(redisIoAdapter);
This approach significantly improves developer experience by preventing confusion and reducing time spent debugging configuration-related issues.
Enter the URL of a public GitHub repository