-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support adding additional compiler options #311
base: main
Are you sure you want to change the base?
Support adding additional compiler options #311
Conversation
🦋 Changeset detectedLatest commit: d2f5cb5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
❌ Deploy Preview for vite-plugin-checker failed.
|
Seems like f620186 fixes the Pipeline - so #264 is fixed then @fi3ework. As this repo uses conventional commits consider rewriting commit messages @EliLichtblau. |
|
||
if (typeof pluginConfig.typescript === 'object' && pluginConfig.typescript.buildMode) { | ||
const host = ts.createSolutionBuilderWithWatchHost( | ||
ts.sys, | ||
createProgram, | ||
/* eslint-disable */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Why disable eslint @EliLichtblau?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theres a lint rule that makes it impossible to make a function that takes I think more than 3 arguments iirc - this needs to take 6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try using Rest parameters instead. Disabling eslint should be the last resort i guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe philosophical difference but I disable eslint when making eslint happy makes the code harder to understand. Imo rest parameters make this code that is currently clear less clear. If the maintainer asks me I'll happily make the change but until then I think disabling eslint is probably the right call
/** | ||
* Additional Compiler options to merge with tsconfig | ||
*/ | ||
extraTSOptions: ts.CompilerOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Are docs changed needed here @EliLichtblau?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change the docs if wanted - I thought the comment would be clear in intellisense - I think the mistake here is I didn't make "extraTSOptions" optional which was an oversight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be added to the docs here I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! will do now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in ee392c7
@jhoermann Do you not squash/rebase. on merge? I can change the title to be "conventional commit" or I can change all of them if needed. Let me know! |
Squashing should work - depends on what @fi3ework thinks as I'm not the owner of this repo. |
This small PR adds the ability for users to supply additional tsconfig options to merge with the tsconfig that is used.
This is useful in the context of the monorepo where I can use vite resolve alias to get hmr passed package boundary however if I change the type signature I do not get type hints.
See this example repo - when I make a change in formatters I want a declaration emit compile so I can get the types and vite do its normal hot loading.
I would really appreciate it if you consider merging - thanks so much!