TypeScript Compiler Options

strictBindCallApply — TypeScript compiler option

Uses more precise library signatures for Function.bind, call and apply to check receiver and arguments. It cannot recover a precise contract from a value typed any or from a broad Function annotation. Default: inherits the effective strict setting (false when strict is omitted in 5.8.3). With the enforcing setting, the corrected example compiles; the comparison fixture triggers TS2345. Disabling this particular check accepts the comparison fixture. Observed corrected runtime output: '6'. Use two separate files as labeled, then run tsc -p tsconfig.json and node example.js in an isolated directory. Tested with TypeScript 5.8.3 and Node.js 22.16.0; not a single-file live editor example.

Formal Syntax & Structure

typescript syntaxtypescript
{  "compilerOptions": {    "strictBindCallApply": true  }}

Parameters & Attributes

NameTypeDescription
strictBindCallApplybooleanSet explicitly to true or false; omission uses the default described above.

Working Example

Example Snippettypescript
// File: tsconfig.json (JSON; omit this file-label comment){  "compilerOptions": {    "target": "ES2022",    "module": "CommonJS",    "types": [],    "noEmitOnError": true,    "strict": true,    "strictBindCallApply": true  },  "files": [    "example.ts"  ]}// File: example.tsfunction repeat(n: number) { return n * 2; }console.log(repeat.call(undefined, 3));
TypeScript Reference