Comments (10)
FYI, the Angular CLI team rolled back the solution style tsconfig solution a while back due to various issues. See https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit for the nerdy details
from create-vue.
I've checked the Angular CLI document before implementing this feature. Most concerns seem to have been addressed and fixed in TypeScript as of now.
But the vue-tsc
issueβ¦ Let me take some time to think about that further π€
from create-vue.
composite
can be turned off via command line:
vue-tsc --noEmit -p tsconfig.vitest.json --composite false
So I think we can work around this issue by adding that to the scripts
.
from create-vue.
Could do the trick indeed.
It looks like I also need to duplicate:
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
},
in tsconfig.vitest.json
to be able to use imports with @/components
in tests. If that's expected, maybe that should be y default?
I can open a PR to fix all this.
from create-vue.
- Most files in the project are compiled by Vite, they will be benefited from the solution-style tsconfigs due to more accurate types. And as the config is in the main
tsconfig.json
, the lack ofcomposite
support doesn't affect them; - Other files such as
vite.config.ts
,cypress/plugins/index.ts
can get better IDE auto-completion, but aren't type-checked in command-line by default, that's a pity, but I feel it's acceptable. - Cypress Component Testing specs are still properly type-checked;
- Vitest specs aren't type-checked. I didn't expect that. But now that it can be worked around, I still think the trade-off is worth it.
from create-vue.
in
tsconfig.vitest.json
to be able to use imports with@/components
in tests. If that's expected, maybe that should be y default?I can open a PR to fix all this.
Yeah. Didn't realize that. Thanks!
from create-vue.
I opened 2 PRs.
Even if it typechecks, it still looks like that VSCode (with Volar) does not understand an import with @/
.
For example, it still complains if I updates HelloWorld.spec.ts with import HelloWorld from '@/components/HelloWorld.vue'
from create-vue.
For example, it still complains if I updates HelloWorld.spec.ts with
import HelloWorld from '@/components/HelloWorld.vue'
It works in my setup (both with the TypeScript Vue Plugin (Volar) and take-over mode).
Jump to definitions does not work without take-over mode, though. It is a known issue: vuejs/language-tools#435
from create-vue.
Right, it looks like I just needed to restart VSCode π€¦
Should be good once the PR are merged then!
from create-vue.
Fixed in 3.1.5
from create-vue.
Related Issues (20)
- Cannot find module 'vue' in fresh Vue project with Typescript/ESLint HOT 2
- pnpm build error Unknown option: 'vue test: committed'_ Path ' HOT 2
- A project created with create-vue failed to add a new route HOT 3
- pnpm create vue@legacy or pnpm create vue@2 bug HOT 3
- 'create vue@2' exception HOT 1
- Use vitest to make unittest HOT 3
- Use Vite 5 HOT 1
- An error occurred when adding a route HOT 2
- May I ask when the latest version of create-vue can be released? (2023-10-21 to latest) HOT 1
- Documentation on generated files HOT 8
- The 'build' command in the template/config/typescript/package.json file may be incorrect. HOT 2
- How to make the scaffolding files created inside the current directory, without creating a new folder HOT 1
- chore(deps): update dependency chromedriver to v119.0.1 [security]
- Vue recommends enabling isolatedModules, but tsconfig from create-vue doesn't HOT 3
- Vue2's dependencies are outdated HOT 6
- ESLint not firing error on console.log? HOT 1
- Using --nightwatch will give out several warnings with npm create HOT 2
- Change `--test or --with-test` to mean `--vitest --playwright` instead of `--vitest --cypress` HOT 2
- /bin/sh: /opt/homebrew/bin/create-vue@latest: No such file or directory HOT 1
- ESlint plugin playwright
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-vue.