Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
"vsix": "mkdirp ../bin && vsce package --no-dependencies --out ../bin",
"publish:marketplace": "vsce publish --no-dependencies && ovsx publish --no-dependencies",
"watch:bundle": "pnpm bundle --watch",
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json",
"watch:tsc": "cd .. && tsc --noEmit --watch --project src/tsconfig.json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is changing the working directory the most maintainable approach here? I'm wondering if there might be alternative solutions that could achieve the same result without requiring the script to cd ...

For example:

  • Could we use TypeScript's --rootDir CLI flag instead?
  • Would adjusting the include paths in tsconfig.json work?
  • Could we leverage the baseUrl compiler option?

The current approach works, but I'm curious if you considered these alternatives and what led to choosing this specific solution?

Copy link
Contributor Author

@bbenshalom bbenshalom Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually the only change I managed to come up with that can be minimal in the command itself.
Changing the include paths or baseUrl doesn't affect error reporting. The --rootDir only works with an absolute path (which isn't viable).

Only other alternative I could think of was to write a script instead of a one liner, which is even uglier.

"clean": "rimraf README.md CHANGELOG.md LICENSE dist mock .turbo"
},
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"noImplicitReturns": true,
"noUnusedLocals": false,
"resolveJsonModule": true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about the implications of removing rootDir. Could this affect TypeScript's module resolution or output structure in other build scenarios beyond the watch mode?

For instance, would this change how TypeScript resolves relative imports or affect the structure of declaration files if they were to be generated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how it would affect ts module resolution. There are two tsc commands that use this tsconfig.json, and they're both without output because of --noEmit. The actual compilation is done by esbuild. So our change really only affects the error reporting.

(Plus, I think it's a better practice and the original rootDir property isn't beneficial in any way)

"rootDir": ".",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
Expand Down
Loading