work-in-progress atproto PDS
typescript atproto pds atcute
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: better explanation on when optional parameter is good

Mary eb2968ea bdeaf729

+6 -5
+6 -5
CLAUDE.md
··· 28 28 - avoid barrel exports (index files that re-export from other modules); import directly from source 29 29 - use `// #region <name>` and `// #endregion` to denote regions when a file needs to contain a lot 30 30 of code 31 - - prefer required parameters over optional ones; optional parameters are acceptable when: 32 - - the default is obvious and used by the vast majority of callers (e.g., `encoding = 'utf-8'`) 33 - - it's a configuration value with a sensible default (e.g., `timeout = 5000`) 34 - - avoid optional parameters that change behavioral modes or make the function do different things 35 - based on presence/absence; prefer separate functions instead 31 + - optional parameters should only exist when callers actually vary in what they pass: 32 + - if all callers use the default, hardcode it instead of making it a parameter 33 + - if all callers must pass a value (e.g. forwarding), make it required 34 + - good optional parameters: config values with sensible defaults that some callers override (e.g., 35 + `timeout = 5000` where most use the default but some need custom values) 36 + - avoid optional parameters that change behavioral modes; prefer separate functions instead 36 37 - when adding optional parameters for backwards compatibility, consider whether a new function with 37 38 a clearer name would be better 38 39