Code Monkey home page Code Monkey logo

Comments (10)

cexbrayat avatar cexbrayat commented on May 3, 2024

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.

sodatea avatar sodatea commented on May 3, 2024

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.

sodatea avatar sodatea commented on May 3, 2024

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.

cexbrayat avatar cexbrayat commented on May 3, 2024

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.

sodatea avatar sodatea commented on May 3, 2024
  • 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 of composite 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.

sodatea avatar sodatea commented on May 3, 2024

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.

cexbrayat avatar cexbrayat commented on May 3, 2024

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.

sodatea avatar sodatea commented on May 3, 2024

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.

cexbrayat avatar cexbrayat commented on May 3, 2024

Right, it looks like I just needed to restart VSCode 🀦
Should be good once the PR are merged then!

from create-vue.

sodatea avatar sodatea commented on May 3, 2024

Fixed in 3.1.5

from create-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.