vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.55k stars 373 forks source link

Feature: add feature about custom options to use own tsconfig.json #4468

Closed tsukuha closed 3 days ago

tsukuha commented 1 week ago

Abstract

I created pull request about this discussions https://github.com/vuejs/language-tools/discussions/4466

About Test

- tsconfig.json
```json
{
    "compilerOptions": {
        "strict": true,
    }
}
johnsoncodehk commented 5 days ago

First of all, thank you for your PR. vue-tsc itself already supports tsc's --project option. Is this PR intended to achieve different behavior from the original --project option?

tsukuha commented 3 days ago

@johnsoncodehk Thanks for your reply. I thought vue-tsc is not supported to set own tsconfig.json path by tsc's --project option. I write the reason below.

executed vue-tsc@2.0.22

$ npx vue-tsc --noEmit --project ./tsconfig.json ./pages/index.vue
error TS5042: Option 'project' cannot be mixed with source files on a command line.

- tsconfig.json
```json
{
    "compilerOptions": {
        "noEmit": true,
        "strict": true,
        "noUncheckedIndexedAccess": true,
    },
    "exclude": ["node_modules"]
}

according to your reply

vue-tsc itself already supports tsc's --project option

It is a bug, isn't it?

I challenged to add code for fixed this problem, but I found this PR is still not enough fixed to this problem.

tsukuha commented 3 days ago

Oh, sorry.

I found it is a tsc's specification.

Allow tsconfig.json when input files are specified #27379 https://github.com/microsoft/TypeScript/issues/27379

I will close this PR and Discussion https://github.com/vuejs/language-tools/discussions/4466 .

tsukuha commented 3 days ago

this problem is a tsc's specification.

Allow tsconfig.json when input files are specified #27379 https://github.com/microsoft/TypeScript/issues/27379

I will close this PR and Discussion https://github.com/vuejs/language-tools/discussions/4466 .