- Error
- Reported by the tsconfig loader
TS5062
Substitution '{0}' in pattern '{1}' can have at most one '*' character.
A substitution in the paths option has more than one * wildcard. Use at most one * in each target path.
What it means
In compilerOptions.paths, each target path in a pattern's array may contain at most one *, which receives what the key's * matched.
Example
{
"compilerOptions": {
"strict": true,
"target": "es2022",
"module": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"paths": {
"@app/*": [
"./src/*/*"
]
}
}
}
export const x = 1;
ts-r-check -p tsconfig.json --pretty false ts-r outputtsconfig.json(10,9): error TS5062: Substitution './src/*/*' in 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
- Use a single
*in each substitution:"@app/*": ["src/*"].