- Error
- Reported by the binder
TS1212
Identifier expected. '{0}' is a reserved word in strict mode.
A word reserved in strict mode (such as `interface`, `package` or `private`) is used as a name in strict-mode code. Rename it.
What it means
In strict mode some extra words are reserved: implements, interface, let, package, private, protected, public, static and yield. They can't be used as variable, function or parameter names. This code is for scripts with "use strict"; modules and classes report TS1214 and TS1213.
Example
"use strict";
var interface = 1;
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(2,5): error TS1212: Identifier expected. 'interface' is a reserved word in strict mode.
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
- Rename the binding, for example
iface.