Skip to content
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

test: validate types in JS script tags #3465

Closed
wants to merge 3 commits into from
Closed

Conversation

rchl
Copy link
Collaborator

@rchl rchl commented Aug 2, 2023

Enable type validation in plain JS script tags in tests.

Extracted from #3353

@johnsoncodehk
Copy link
Member

non-strict-template/#3353 is deliberate to not report errors, to make sure our codegen will not make TS errors reporting for JS script blocks by default.

Can you create tsconfig in a new directory under packages/vue-test-workspace/vue-tsc to enable checkJs and place the new test?

@rchl
Copy link
Collaborator Author

rchl commented Sep 6, 2023

non-strict-template/#3353 is deliberate to not report errors, to make sure our codegen will not make TS errors reporting for JS script blocks by default.

Are you sure? Reading #3121 it appears to be about particular slot syntax not reporting errors rather than the whole template not reporting errors. With checkJs enabled and the fix for the original issue reverted it will still fail.

* master:
  feat: support nested plugins (vuejs#3530)
  chore: add formatter for vue files (vuejs#3532)
  chore: add test for defineExpose
  Update README.md (vuejs#3486)
  doc: fix typo (vuejs#3461)
  chore: support custom configPath for createParsedCommandLineByJson (vuejs#3456)
  fix: correctly hyphen-case props (vuejs#3424)
  feat: Add Portuguese language (vuejs#3535)
  chore: format
  refactor: use volar services via a better interop way
  chore: bump volar services
  refactor: clear up tsconfigs
  chore: update sponsor
  chore: remove `resolution-mode=highest` for pnpm 8.7.0
@johnsoncodehk
Copy link
Member

Maybe I didn't make it clear enough. We do want #3353/main.vue to not report an error because the same code in .js will also not report an error with checkJs disabled, and we want the script tag to behave consistently with .js.

@rchl rchl deleted the fix/js-check branch October 22, 2023 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants