- Error
- Reported by the type checker
TS1030
'{0}' modifier already seen.
The same modifier is written twice on one declaration. Delete the repeated one.
What it means
A modifier such as readonly, static or abstract can appear only once on a declaration. It's reported on the second occurrence. Repeated accessibility modifiers are reported as TS1028 instead.
Example
export class User {
readonly readonly id = 1;
}
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(2,12): error TS1030: 'readonly' modifier already seen.
Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.
How to fix
- Remove the duplicate modifier.