• Error
  • Reported by the tsconfig loader

TS5061

Pattern '{0}' can have at most one '*' character.

A key in the paths option has more than one * wildcard. Use at most one * per pattern.

What it means

In compilerOptions.paths, each key is a module-name pattern that may contain one *. A key with two or more is invalid.

Example

tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "target": "es2022",
    "module": "esnext",
    "moduleResolution": "bundler",
    "noEmit": true,
    "paths": {
      "@app/*/*": [
        "./src/*"
      ]
    }
  }
}
index.ts
export const x = 1;
ts-r-check -p tsconfig.json --pretty false ts-r output
tsconfig.json(9,7): error TS5061: Pattern '@app/*/*' can have at most one '*' character.

Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01.

How to fix

  • Rewrite the pattern with a single *, for example "@app/*": ["src/*"].