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: add jsconfig.json for base template #102

Merged
merged 3 commits into from
Nov 10, 2023
Merged

Conversation

GraxMonzo
Copy link
Contributor

@GraxMonzo GraxMonzo commented May 19, 2022

Create-vue doesn't create a jsconfig.json file on the first initialization without TS. Added jsconfig.json with aliased paths to base template for out of the box VSCode IntelliSense

@GraxMonzo GraxMonzo changed the title feat(template): add jsconfig.json for base template feat: add jsconfig.json for base template Mar 29, 2023
Copy link
Member

@cexbrayat cexbrayat left a comment

Choose a reason for hiding this comment

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

@GraxMonzo Thanks for the PR!

Have you tried it out? I'm wondering if putting the file in base won't add it for all types of projects, even the TS ones.

@cexbrayat
Copy link
Member

@sodatea Do you have an opinion on adding a jsconfig.json file in the generated (non-TS project)?

@sodatea
Copy link
Member

sodatea commented Nov 10, 2023

I'm fine with adding a jsconfig.json. But I'm not sure what are the best practices

@GraxMonzo
Copy link
Contributor Author

@GraxMonzo Thanks for the PR!

Have you tried it out? I'm wondering if putting the file in base won't add it for all types of projects, even the TS ones.

Hey @cexbrayat. Yes I tried it and tried it without the baseUrl and it works. Well I guess baseUrl is redundant here, because as of TypeScript 4.1, you no longer need to specify baseUrl when using paths.
https://www.typescriptlang.org/tsconfig#baseUrl

Thank you for your time.

@cexbrayat
Copy link
Member

@GraxMonzo Sorry I wasn't clear: I meant that the file you added is in template/base so I'm wondering if it does not get added to all the generated projects with create-vue, even the one where the users pick TypeScript

@GraxMonzo
Copy link
Contributor Author

@cexbrayat Pardon me for misreading you. I haven't tested this with another template but I might think this line of code solves this problem https://github.com/vuejs/create-vue/blob/main/index.ts#L455

@cexbrayat
Copy link
Member

👍 Awesome, so maybe you can remove the baseUrl from the config if it isn't needed and then we'll be able to merge it

@GraxMonzo
Copy link
Contributor Author

@cexbrayat Done

Copy link
Member

@sodatea sodatea left a comment

Choose a reason for hiding this comment

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

According to https://code.visualstudio.com/docs/languages/jsconfig#_examples we need to explicitly exclude node_modules and dist here.

@cexbrayat cexbrayat merged commit 0f73c9b into vuejs:main Nov 10, 2023
101 checks passed
@cexbrayat
Copy link
Member

Thanks @GraxMonzo !

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

3 participants