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

feat(template-vue): add jsconfig.json #1379

Closed
wants to merge 1 commit into from
Closed

feat(template-vue): add jsconfig.json #1379

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 5, 2021

helps suppress Vetur warning

helps suppress Vetur warning
@yyx990803
Copy link
Member

What Vetur warning?

@ghost
Copy link
Author

ghost commented Jan 5, 2021

(when App.vue or any .vue file is active in the editor)

2021-01-06_004100

@Shinigami92
Copy link
Member

question: do we want a jsconfig.json also for the other templates? Or is it just for the vue package?

@Shinigami92 Shinigami92 added the p1-chore Doesn't change code behavior (priority) label Mar 23, 2021
@aminya
Copy link
Contributor

aminya commented Mar 23, 2021

question: do we want a jsconfig.json also for the other templates? Or is it just for the vue package?

This is a Vue-specific error.

@Shinigami92
Copy link
Member

Still seeing the warning 🤔
Are you sure that this fixed it?

Peek.2021-03-23.17-02.mp4

@aminya
Copy link
Contributor

aminya commented Mar 23, 2021

When you open the folder as the top-level project the error doesn't show up:
image

But opening it as a sub-folder triggers the issue.
image

@yoyo930021 might be able to fix this in vls

@Shinigami92
Copy link
Member

Last question (I hope ^^): if there is now an jsconfig.json in the template itself, will it (or will it not) shipped / extracted when creating a new app with yarn create @vitejs/app frontend --template vue?

If not, @matias-capeletto can feel free to merge it
Otherwise we should at least check if the jsconfig.json could be improved so it can be useful in a new created app.

@ghost
Copy link
Author

ghost commented Mar 23, 2021

Still seeing the warning 🤔

Open only template-vue folder in vscode, not the whole repo

@yoyo930021
Copy link
Contributor

yoyo930021 commented Mar 24, 2021

When you open the folder as the top-level project the error doesn't show up:
But opening it as a sub-folder triggers the issue.
@yoyo930021 might be able to fix this in vls

It is a design, not a bug. If you want to open sub-folder, you need to set vetur.config.js.
https://vuejs.github.io/vetur/guide/#monorepo

This warning is designed by @vue/cli projects or other projects.
The user will know vetur reading this config file or not.
The @vue/cli has a default path alias, so we need to use jsconfig.json for vls to know that aliases exist.
So I open a PR in @vue/cli. vuejs/vue-cli#6285

Vite doesn't have any default path alias, so I think we don't need to have built-in jsconfig.json.
We can use vetur.ignoreProjectWarning: true to close this warning in this case.

For more information about this warning:
https://vuejs.github.io/vetur/guide/FAQ.html#vetur-can-t-find-tsconfig-json-jsconfig-json-in-xxxx-xxxxxx

PS. This file also used by other editor support. Like: VueDX, Volar.
We just have too many issues about this, so I make this warning.

@patak-dev
Copy link
Member

@web2033 would you like to modify this PR to use vetur.ignoreProjectWarning: true as suggested or do you prefer to close this one and do this in another PR? (you or maybe someone else)

@ghost
Copy link
Author

ghost commented Mar 27, 2021

would you like to modify this PR to use vetur.ignoreProjectWarning: true as suggested or do you prefer to close this one and do this in another PR? (you or maybe someone else)

I'm not sure I understood this. You cannot put vetur settings in jsconfig.json file.
Feel free to redo PR. I still think it was the easiest option to leave it as is.

@ghost ghost closed this Mar 27, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-chore Doesn't change code behavior (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants