Maintain consistent naming patterns and casing across all related code entities to ensure clarity and prevent errors. This includes:
Example:
// CORRECT: Consistent casing of 'checkJs' option
// In code:
compiler.options.checkJs = true;
// In documentation:
// "Use the 'checkJs' option to get errors from JavaScript files."
// CORRECT: Consistent naming across related entities
type Foo = number;
namespace Foo {
export type U = string;
}
export = Foo;
// When renaming 'Foo', ensure it's renamed in all three places
Inconsistent naming leads to confusion, makes code harder to maintain, and can cause runtime errors when references don’t match.