jsconfig.json key

include

  • Default ["**/*"]
  • Since TypeScript 2.0

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

src/cart/total.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: src/cart/total.js(4,49): error TS2551: Property 'prise' does not exist on type '{ price: number; }'. Did you mean 'price'? 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. src/cart/total.js(4,49): error TS2551: Property 'prise' does not exist on type '{ price: number; }'. Did you mean 'price'? 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. src/cart/total.js(4,49): error TS2551: Property 'prise' does not exist on type '{ price: number; }'. Did you mean 'price'? checked 21 October 2026
/** @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'?
}
include ["src"]: a folder name picks up every .js file under it.
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

Last reviewed 20 October 2026.