TS1029
'public' modifier must precede 'abstract' modifier.
Broken Code ❌
abstract class Animal {
public abstract makeNoise(): string;
}Fixed Code ✔️
They keywords public, private, and protected define the access to a class member. Access modifiers have to be defined first in TypeScript.
Solution 1:
abstract class Animal {
public abstract makeNoise(): string;
}Solution 2:
The visibility is public by default, so you don't have to explicitly declare it:
abstract class Animal {
abstract makeNoise(): string;
}