Use naming that is unambiguous, consistent with the codebase, and semantically accurate.
Apply:
*Params*, don’t introduce *Opts* for the same concept (and avoid opts vs params drift).toString) for domain helpers—prefer explicit names (e.g. errToString).Example (shadowing + rename):
function isValidCreditCard(cardNumber: string): boolean {
const isLuhnAlgo = (sanitizedCardNumber: string): boolean => {
// ...
return true;
};
return isLuhnAlgo(cardNumber);
}
Example (terminology + semantics):
params.async (not opts.async) if the repo’s standard is Params.step over a confusing alias like mod when it’s meant to align with “step” semantics from familiar APIs.Enter the URL of a public GitHub repository