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

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

Closed

Conversation

tsukuha
Copy link

@tsukuha tsukuha commented Jun 13, 2024

Abstract

I created pull request about this discussions #4466

About Test

  • vue file
<script setup lang="ts">
	const a: number = ''
</script>

<template></template>
  • tsconfig.json
{
	"compilerOptions": {
		"strict": true,
	}
}
  • command
./packages/tsc/bin/vue-tsc.js --project ./packages/tsc/playground/tsconfig.json ./packages/tsc/playground/index.vue
  • logs
    スクリーンショット 2024-06-14 13 50 01

@tsukuha tsukuha force-pushed the tsukuha/vue-tsc-add-own-tsconfig-options branch from 5b6e9b0 to 5a620f5 Compare June 13, 2024 10:43
@tsukuha tsukuha marked this pull request as ready for review June 13, 2024 10:47
@tsukuha tsukuha force-pushed the tsukuha/vue-tsc-add-own-tsconfig-options branch from 25dc500 to d8a92e4 Compare June 13, 2024 11:05
@johnsoncodehk
Copy link
Member

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
Copy link
Author

tsukuha commented Jun 23, 2024

@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.
  • index.vue
<script setup lang="ts">
function test(arr: string[]) {
  const a: string = arr[1]
}
</script>

<template>
  <div>
    <button type="button" @click="test([])"></button>
  </div>
</template>
  • tsconfig.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
Copy link
Author

tsukuha commented Jun 23, 2024

Oh, sorry.

I found it is a tsc's specification.

Allow tsconfig.json when input files are specified #27379
microsoft/TypeScript#27379

I will close this PR and Discussion #4466 .

@tsukuha
Copy link
Author

tsukuha commented Jun 23, 2024

this problem is a tsc's specification.

Allow tsconfig.json when input files are specified #27379
microsoft/TypeScript#27379

I will close this PR and Discussion #4466 .

@tsukuha tsukuha closed this Jun 23, 2024
@tsukuha tsukuha deleted the tsukuha/vue-tsc-add-own-tsconfig-options branch June 23, 2024 11:07
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.

2 participants