support extends "tstl" object for tsconfig.json in node_modules#1440
support extends "tstl" object for tsconfig.json in node_modules#1440Perryvw merged 4 commits intoTypeScriptToLua:masterfrom
Conversation
upgrade typescript to 5.0.4 to fix extends resolving. microsoft/TypeScript#53443
upgrade typescript to 5.0.4 to fix extends resolving. microsoft/TypeScript#53443
src/cli/tsconfig.ts
Outdated
| return updateParsedConfigFile(parsedConfigFile); | ||
| } | ||
|
|
||
| function pathIsRelative(path: string): boolean { |
There was a problem hiding this comment.
Could you add a comment on this function explaining why we need it and how it's different from path.absolute? Took a lot of mental effort to understand the need for this, and I'm sure I will have forgotten again next week!
There was a problem hiding this comment.
First condition path.isAbsolute is for absolute path like D:/my-project/tsconfig.json,
Second condition pathIsRelative is for relative path like ./folder/tsconfig.json,
Final is the npm module path like @pilaoda/ts-config/tsconfig.dev.json
pathIsRelative is simply copy from typescript sourcecode https://github.com/microsoft/TypeScript/blob/c333e14578984d0071da63fc28147f1e6fc43ae0/src/compiler/path.ts#LL95C1-L102C2
to keep consistent with its extends behavior
There was a problem hiding this comment.
I found ts just export it but mark internal, so I add declaration for them and use both ts.pathIsAbsolute and ts.pathIsRelative.
…ot relative that it is then a module path that needs to be resolved
#1436 doesn't handle such case:
This PR fix this with ts internal API.