SOLID Principles in JavaScript
What SOLID principle is violated when an interface forces its clients to implement methods they don't need?
interface SmartDevice {
turnOn(): void;
turnOff(): void;
connect(): void;
disconnect(): void;
play(): void;
pause(): void;
adjustVolume(level: number): void;
setBrightness(level: number): void;
}
class SmartLight implements SmartDevice {
// Must implement all methods, even though a light
// doesn't need play(), pause(), or adjustVolume()
}