When you assign a function to a variable or property with a function type, strictFunctionTypes checks that the function can handle every argument the type allows. A function that only accepts strings cannot stand in for one that may be called with a number; without the option, TypeScript lets it through.
It is part of strict and arrived with TypeScript 2.6.
At a glance
| Write | Leave it to strict; write "strictFunctionTypes": false only to turn this one check back off |
|---|---|
| On the command line | --strictFunctionTypes |
| Type | boolean |
| Default in TypeScript 5.9 | false (on when strict is on) |
| Default from TypeScript 6.0 | true, through strict (TypeScript 6.0) |
| TypeScript's description | When assigning functions, check to ensure parameters and the return values are subtype-compatible. |
The description is quoted from TypeScript's own option list (Apache-2.0); see the notices.
Examples
/** @type {(value: string | number) => void} */
let log;
/** @param {string} text */
function shout(text) {
console.log(text.toUpperCase());
}
log = shout;error TS2322: Type '(text: string) => void' is not assignable to type '(value: string | number) => void'.
Types of parameters 'text' and 'value' are incompatible.
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
log(42);jsconfig.json for this example
{
"compilerOptions": {
"checkJs": true,
"noEmit": true,
"strict": true,
"target": "es2022",
"module": "nodenext",
"types": []
},
"include": [
"*.js"
]
} /** @type {(value: string | number) => void} */
let log;
/** @param {string} text */
function shout(text) {
console.log(text.toUpperCase());
}
log = shout;
log(42);jsconfig.json for this example
{
"compilerOptions": {
"checkJs": true,
"noEmit": true,
"strict": true,
"target": "es2022",
"module": "nodenext",
"types": [],
"strictFunctionTypes": false
},
"include": [
"*.js"
]
} Methods are exempt
TypeScript's 2.6 release notes say the stricter rule applies to function types, not to methods. In JSDoc that is the difference between a property holding a function, { log: (value: string) => void }, which is checked strictly, and the method shorthand, { log(value: string): void }, which is not. Prefer the property form in a @typedef when you want the check.
Gotchas
- The example's
log(42)would calltoUpperCaseon a number at run time; with the option off, nothing reports it.
Sources
- TSConfig Reference: strictFunctionTypes · TypeScript
- TypeScript 2.6 release notes · TypeScript handbook
Last reviewed 20 October 2026.