if (configs.length === 1) {
matchedConfig = configs[0]
} else {
+ const [major, minor] = ts.versionMajorMinor.split('.').map(Number)
+ function getPattern(base: string, p: string): string {
+ return p.startsWith('${configDir}') && major >= 5 && minor >= 5
+ ? // ts 5.5+ supports ${configDir} in paths
+ p.replace('${configDir}', dirname(configPath!))
+ : joinPaths(base, p)
+ }
// resolve which config matches the current file
for (const c of configs) {
const base = normalizePath(
const excluded: string[] | undefined = c.config.raw?.exclude
if (
(!included && (!base || containingFile.startsWith(base))) ||
- included?.some(p => isMatch(containingFile, joinPaths(base, p)))
+ included?.some(p => isMatch(containingFile, getPattern(base, p)))
) {
if (
excluded &&
- excluded.some(p => isMatch(containingFile, joinPaths(base, p)))
+ excluded.some(p => isMatch(containingFile, getPattern(base, p)))
) {
continue
}