jsconfig.json key

files

  • Default not set
  • Tested with TypeScript 5.9

files is the exact-list version of include: file paths, no patterns, relative to the config file. A path that does not exist is an error. When both are set, the program starts from both lists.

As with include, imports pull more files in: start from src/main.js alone and every file it imports is read and checked, as the example shows. That makes files handy for an entry-point-only config, such as one that checks a script and nothing else.

At a glance

Write Rarely needed: include with a folder or pattern is easier to keep up to date
On the command line No flag: only a config file can set it
Type string[]
Default in TypeScript 5.9 not set
Description in the tsconfig.json schema Specifies an allowlist of files to include in the program.

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.

Examples

src/format.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: src/format.js(2,29): error TS7006: Parameter 'cents' implicitly has an 'any' type. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. src/format.js(2,29): error TS7006: Parameter 'cents' implicitly has an 'any' type. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. src/format.js(2,29): error TS7006: Parameter 'cents' implicitly has an 'any' type. checked 21 October 2026
export function formatPrice(cents) {error TS7006: Parameter 'cents' implicitly has an 'any' type.
  return `$${(cents / 100).toFixed(2)}`;
}
files ["src/main.js"]: the files it imports come along and are checked.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "files": [
    "src/main.js"
  ]
}

A config for one entry point

A small repository can keep a second config, say jsconfig.scripts.json, with "files": ["scripts/release.js"], and check it with tsc -p jsconfig.scripts.json. Everything that script imports is checked with it, and nothing else is.

Gotchas

  • With files set and no include, the default include of everything no longer applies.

Sources

Last reviewed 20 October 2026.