Skip to content

chore: add type check during ci #85

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/vite/src/components/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</button>
</template>

<script>
<script lang="ts">
import './button.css'
import { reactive, computed } from 'vue'

Expand All @@ -28,7 +28,7 @@
size: {
type: String,
validator: function (value) {
return ['small', 'medium', 'large'].includes(value)

Check failure on line 31 in examples/vite/src/components/Button.vue

View workflow job for this annotation

GitHub Actions / lint

Argument of type 'unknown' is not assignable to parameter of type 'string'.
},
},
backgroundColor: {
Expand Down
2 changes: 1 addition & 1 deletion examples/vite/src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</header>
</template>

<script>
<script lang="ts">
import './header.css'
import MyButton from './Button.vue'

Expand Down
2 changes: 1 addition & 1 deletion examples/vite/src/components/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>
</template>

<script setup>
<script setup lang="ts">
import { ref } from 'vue'
import Button from './Button.vue'

Expand Down
2 changes: 1 addition & 1 deletion examples/vite/src/components/Page.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<article>
<my-header
:user="user"

Check failure on line 4 in examples/vite/src/components/Page.vue

View workflow job for this annotation

GitHub Actions / lint

Type 'null' is not assignable to type 'Record<string, any> | undefined'.
@login="onLogin"
@logout="onLogout"
@createAccount="onCreateAccount"
Expand Down Expand Up @@ -78,7 +78,7 @@
</article>
</template>

<script>
<script lang="ts">
import './page.css'
import MyHeader from './Header.vue'

Expand All @@ -95,13 +95,13 @@

methods: {
onLogin() {
this.user = { name: 'Jane Doe' }

Check failure on line 98 in examples/vite/src/components/Page.vue

View workflow job for this annotation

GitHub Actions / lint

Type '{ name: string; }' is not assignable to type 'null'.
},
onLogout() {
this.user = null
},
onCreateAccount() {
this.user = { name: 'Jane Doe' }

Check failure on line 104 in examples/vite/src/components/Page.vue

View workflow job for this annotation

GitHub Actions / lint

Type '{ name: string; }' is not assignable to type 'null'.
},
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup>
<script setup lang="ts">
import { userEvent, within } from '@storybook/testing-library'
import { expect } from '@storybook/jest'
import LoginForm from '../components/LoginForm.vue'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"dev": "tsup --watch src",
"prepublishOnly": "pnpm test && pnpm build",
"build:fix": "jiti scripts/postbuild.ts",
"lint": "pnpm lint:eslint && pnpm lint:prettier",
"lint": "pnpm lint:types && pnpm lint:eslint && pnpm lint:prettier",
"lint:types": "vue-tsc --noEmit -p tsconfig.check-types.json",
"lint:eslint": "eslint --report-unused-disable-directives .",
"lint:prettier": "prettier --check --ignore-path .gitignore . \"!pnpm-lock.yaml\"",
"play": "npm -C playground run dev",
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.check-types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"skipLibCheck": true
},
"exclude": ["dist"]
}
Loading