TS5023
TypeScriptERRORCommonConfigurationHIGH confidence

Unknown compiler option

What this means

A compiler option specified in the 'tsconfig.json' file is not a valid TypeScript compiler option.

Why it happens
  1. 1A typo in the name of a compiler option.
  2. 2The compiler option is from a newer version of TypeScript than the one being used.
  3. 3Including a property in 'compilerOptions' that is not a recognized setting.
How to reproduce

An invalid option in tsconfig.json.

trigger — this will error
trigger — this will error
{
  "compilerOptions": {
    "target": "es6",
    "strict": true,
    "strictmode": true // Typo for strict
  }
}

expected output

error TS5023: Unknown compiler option 'strictmode'. Did you mean 'strict'?

Fix 1

Correct the option name

WHEN The option is misspelled.

Correct the option name
{
  "compilerOptions": {
    "target": "es6",
    "strict": true
  }
}

Why this works

Using the correct name as documented by TypeScript.

Fix 2

Update TypeScript version

WHEN The option is valid but not supported by the current version.

Update TypeScript version
// Run in terminal:
// npm install typescript@latest

Why this works

Upgrading the TypeScript compiler to a version that recognizes the option.

What not to do

Remove the option without understanding it

The option may be important for code quality or behavior, and its purpose should be understood before removal.

Sources
Official documentation ↗

microsoft/TypeScript src/compiler/diagnosticMessages.json

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All TypeScript errors