8000 fix: fix the ts version selected by the user by huangmingfu · Pull Request #305 · vuejs/repl · GitHub
[go: up one dir, main page]

Skip to content

fix: fix the ts version selected by the user #305

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

Merged
merged 9 commits into from
Feb 19, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: ts version selected by the user
  • Loading branch information
huangmingfu committed Feb 19, 2025
commit 1f1b81d2f61e793c27756e8c14e7c567a9e007e5
4 changes: 2 additions & 2 deletions src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function useStore(
vueVersion = ref(null),

locale = ref(),
typescriptVersion = ref('latest'),
typescriptVersion = ref(null),
dependencyVersion = ref(Object.create(null)),
reloadLanguageTools = ref(),
}: Partial<StoreState> = {},
Expand Down Expand Up @@ -434,7 +434,7 @@ export type StoreState = ToRefs<{

// volar-related
locale: string | undefined
typescriptVersion: string
typescriptVersion: string | null
Copy link
Collaborator

Choose a reason for hiding this comment

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

Type 'string | null' is not assignable to type 'string'.
https://github.com/vuejs/repl/blob/main/src/monaco/env.ts#L140
https://github.com/vuejs/repl/blob/main/src/monaco/env.ts#L77


Perhaps the impact of this change would be minimal.

// L273
if (typescriptVersion.value !== 'latest' || files._tsVersion) {
  files._tsVersion = typescriptVersion.value
}

Copy link
Contributor Author
@huangmingfu huangmingfu Feb 19, 2025

Choose a reason for hiding this comment

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

Forgot to run the typecheck command to check. Thank you for your suggestion. I have already modified it.❤️

/** \{ dependencyName: version \} */
dependencyVersion: Record<string, string>
reloadLanguageTools?: (() => void) | undefined
Expand Down
0