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

No way to customize VLS settings #85

Closed
ascott18 opened this issue Nov 12, 2021 · 3 comments · Fixed by #86
Closed

No way to customize VLS settings #85

ascott18 opened this issue Nov 12, 2021 · 3 comments · Fixed by #86

Comments

@ascott18
Copy link
Contributor

ascott18 commented Nov 12, 2021

Unless I'm missing something, it doesn't appear there's a way to customize the settings passed to VLS.

I want to perform type checking on my <script lang=ts>, but not on my templates. It seems these settings are hardcoded in initParams and there's no way to override them. Is there something I'm missing?

@ascott18
Copy link
Contributor Author

I'm working on a PR for this.

@fi3ework
Copy link
Owner

Sorry for the late response, but I believe you can customize the VLS' configuration by https://vuejs.github.io/vetur/reference/#example. Would you like to have a try?

@ascott18
Copy link
Contributor Author

That's true, but that affects VS Code's behavior as well.

I want to be able to turn off template and interpolation validation for the build, but keep those enabled within VS Code. Reason being is that I want that feedback in VS code because its often useful, but sometimes there are typescript errors within the template (usually Object is possibly 'null') that are not actually real errors. Typically one would suppress these with a Typescript definitely-assigned !, or a null-propagating ?. but in Vue 2, typescript syntax cannot be used in templates, nor can newer JS operators like ?..

Essentially, I'm trying to replicate the behavior of vue-cli. Typescript validation on <script lang="ts"> blocks, but not on the template.

I submitted a PR #86 that enables the vetur settings to be overridden just for this plugin.

fi3ework pushed a commit to ascott18/vite-plugin-checker that referenced this issue Jan 17, 2022
# Conflicts:
#	packages/vite-plugin-checker/src/checkers/vls/main.ts
#	packages/vite-plugin-checker/src/types.ts
fi3ework pushed a commit that referenced this issue Jan 17, 2022
# Conflicts:
#	packages/vite-plugin-checker/src/checkers/vls/main.ts
#	packages/vite-plugin-checker/src/types.ts
fi3ework pushed a commit that referenced this issue Jan 29, 2022
# Conflicts:
#	packages/vite-plugin-checker/src/checkers/vls/main.ts
#	packages/vite-plugin-checker/src/types.ts
fi3ework pushed a commit that referenced this issue Feb 6, 2022
# Conflicts:
#	packages/vite-plugin-checker/src/checkers/vls/main.ts
#	packages/vite-plugin-checker/src/types.ts
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 a pull request may close this issue.

2 participants