include is the starting list of files to check: glob patterns resolved relative to the folder that holds the config file. Without include (and without files), TypeScript starts from every supported file under that folder, minus the exclude list.
In a JavaScript project the supported files include .js, .jsx, .mjs and .cjs, because a jsconfig.json allows JavaScript. A pattern that ends in a folder name, such as "src", takes every supported file under it, .ts and .jsx too; a pattern like "src/**/*.js" takes exactly what it says.
At a glance
| Write | ["src/**/*.js"] or ["src"]: the folders with your code, so build output and scripts stay out |
|---|---|
| On the command line | No flag: only a config file can set it |
| Type | string[] |
| Default in TypeScript 5.9 | ["**/*"] (when files is not set) |
| Description in the tsconfig.json schema | Specifies a list of glob patterns that match files to be included in compilation. |
| In the quick-start setups |
|
The description is quoted from the tsconfig.json schema published by SchemaStore (Apache-2.0), which carries the descriptions TypeScript does not ship for top-level keys; see the notices. The setup values are the checked configs on the quick-start pages.
Examples
/** @param {{ price: number }[]} items */
export function total(items) {
return items.reduce((sum, item) => sum + item.prise, 0);error TS2551: Property 'prise' does not exist on type '{ price: number; }'. Did you mean 'price'?
}jsconfig.json for this example
{
"compilerOptions": {
"checkJs": true,
"noEmit": true,
"strict": true,
"target": "es2022",
"module": "nodenext",
"types": []
},
"include": [
"src"
]
} The patterns
Three wildcards, as in most glob tools:
*matches any characters within one folder name,?matches one character**/matches any number of folders, including none- a pattern without an extension or a wildcard in its last part is a folder: every supported file under it
Imports pull files in
include is where the checker starts, not a fence. A file outside it that an included file imports joins the program and is checked too (with checkJs on), as exclude shows.
Gotchas
- Test files often live outside
src; add"test/**/*.js"to check them too, as the jsconfig generator does by default.
Sources
- TSConfig Reference: include · TypeScript
- TypeScript 2.0 release notes · TypeScript handbook
- tsconfig.json schema · SchemaStore
- jsconfig.json · Visual Studio Code docs
Last reviewed 20 October 2026.