- Error
- Reported by the binder
TS1100
Invalid use of '{0}' in strict mode.
`eval` or `arguments` is used as a name in strict-mode code. Rename the variable, parameter or function.
What it means
In strict mode, eval and arguments can't be declared or assigned: not as a variable, function, parameter or catch binding. This code is reported in scripts with a "use strict" directive. Modules and classes are always strict, and report the same mistake as TS1215 and TS1210.
Example
"use strict";
var arguments = 1;
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(2,5): error TS1100: Invalid use of 'arguments' 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
argsorevaluate. - To read all arguments of a function, use a rest parameter:
function f(...args: unknown[]).