Enforce that TypeScript interface names start with I (capital letter) followed by an uppercase character.
| Property | Value |
|---|---|
| Type | suggestion |
| Fixable | No |
| Recommended | warn |
| Strict | error |
Prefixing interface names with I makes it immediately clear in code that a type is an interface rather than a class or type alias. This convention improves readability, especially in large codebases where interfaces are heavily used.
interface IUser {
name: string;
email: string;
}
interface IRepository<T> {
findById(id: string): Promise<T>;
}interface User {
name: string;
}
interface userProfile {
age: number;
}This rule has no options. Enable it in your ESLint config:
'zero-tolerance/require-interface-prefix': 'error'