From 2fd36c32fd0eb7391d58bb9c002c30cfe640666a Mon Sep 17 00:00:00 2001 From: Vivek JM <24496671+vivekjm@users.noreply.github.com> Date: Sun, 12 Jul 2026 12:08:29 +0530 Subject: [PATCH] Document tsconfig extends arrays --- .../copy/en/options/extends.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/tsconfig-reference/copy/en/options/extends.md b/packages/tsconfig-reference/copy/en/options/extends.md index b29043def126..10abacb99864 100644 --- a/packages/tsconfig-reference/copy/en/options/extends.md +++ b/packages/tsconfig-reference/copy/en/options/extends.md @@ -3,10 +3,10 @@ display: "Extends" oneline: "Specify one or more path or node module references to base configuration files from which settings are inherited." --- -The value of `extends` is a string which contains a path to another configuration file to inherit from. -The path may use Node.js style resolution. +The value of `extends` can be a string which contains a path to another configuration file to inherit from, or an array of paths to multiple base configuration files. +Each path may use Node.js style resolution. -The configuration from the base file are loaded first, then overridden by those in the inheriting config file. All relative paths found in the configuration file will be resolved relative to the configuration file they originated in. +The configuration from the base file is loaded first, then overridden by those in the inheriting config file. When `extends` is an array, each configuration is applied in order, with later files overriding settings from earlier files. All relative paths found in the configuration file will be resolved relative to the configuration file they originated in. It's worth noting that [`files`](#files), [`include`](#include), and [`exclude`](#exclude) from the inheriting config file _overwrite_ those from the base config file, and that circularity between configuration files is not allowed. @@ -46,4 +46,15 @@ Currently, the only top-level property that is excluded from inheritance is [`re } ``` +`tsconfig.combined.json`: + +```json tsconfig +{ + "extends": ["./configs/base", "./tsconfig.nostrictnull"], + "compilerOptions": { + "noImplicitAny": false + } +} +``` + Properties with relative paths found in the configuration file, which aren't excluded from inheritance, will be resolved relative to the configuration file they originated in.