Require that interface names be prefixed with I (interface-name-prefix)
December 18, 2018 ยท View on GitHub
It can be hard to differentiate between classes and interfaces. Prefixing interfaces with "I" can help telling them apart at a glance.
Rule Details
This rule enforces consistency of interface naming prefix conventions.
Options
This rule has a string option.
"never"(default) disallows all interfaces being prefixed with"I""always"requires all interfaces be prefixed with"I"
never
TypeScript suggests never prefixing interfaces with "I".
The following patterns are considered warnings:
interface IAnimal {
name: string;
}
The following patterns are not warnings:
interface Animal {
name: string;
}
always
The following patterns are considered warnings:
interface Animal {
name: string;
}
The following patterns are not warnings:
interface IAnimal {
name: string;
}
When Not To Use It
If you do not want to enforce interface name prefixing.
Further Reading
TypeScript Interfaces
Compatibility
TSLint: interface-name