fix: type missing issue

This commit is contained in:
mutoe 2022-06-12 02:49:12 +08:00
parent bb000036fd
commit 275cadd596
No known key found for this signature in database
GPG Key ID: 7197231B847AE2EE
9 changed files with 9 additions and 7 deletions

View File

@ -3,7 +3,6 @@ module.exports = {
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
project: ['./tsconfig.app.json', './tsconfig.config.json', './tsconfig.cypress-ct.json'],
sourceType: 'module',
extraFileExtensions: ['.vue'],
},

View File

@ -8,7 +8,7 @@
"build": "vite build",
"serve": "vite preview --port 4137",
"lint:script": "eslint \"{src/**/*.{ts,vue},cypress/**/*.ts}\"",
"lint:tsc": "vue-tsc --noEmit",
"lint:tsc": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
"lint": "concurrently \"yarn lint:tsc\" \"yarn lint:script\"",
"test:unit": "cypress open --component",
"test:unit:ci": "cypress run --component --quiet --reporter spec",

View File

@ -20,7 +20,7 @@ describe('# AppNavigation', () => {
it('should render xxx when user logged', () => {
const userStore = useUserStore()
userStore.updateUser({ id: 1, username: 'foo', email: '', token: '', bio: undefined, image: undefined })
userStore.updateUser({ username: 'foo', email: '', token: '', bio: '', image: '' })
cy.mount(AppNavigation)
cy.get('.nav-item').should('have.length', 4)

View File

@ -46,9 +46,10 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { Comment } from 'src/services/api'
interface Props {
comment: ArticleComment
comment: Comment
username?: string
}

View File

@ -52,6 +52,7 @@
<script setup lang="ts">
import { useFavoriteArticle } from 'src/composable/useFavoriteArticle'
import type { Article } from 'src/services/api'
import { computed } from 'vue'
interface Props {

View File

@ -39,7 +39,7 @@
</fieldset>
<fieldset class=" form-group">
<input
v-model="form.token"
v-model="form.password"
class="form-control form-control-lg"
type="password"
required

View File

@ -70,6 +70,7 @@ import { storeToRefs } from 'pinia'
import ArticlesList from 'src/components/ArticlesList.vue'
import { useFollow } from 'src/composable/useFollowProfile'
import { useProfile } from 'src/composable/useProfile'
import type { Profile } from 'src/services/api'
import { isAuthorized, useUserStore } from 'src/store/user'
import { computed } from 'vue'
import { useRoute } from 'vue-router'

View File

@ -43,7 +43,7 @@
</fieldset>
<fieldset class="form-group">
<input
v-model="form.password"
v-model="form.token"
type="password"
class="form-control form-control-lg"
placeholder="New Password"

View File

@ -3,5 +3,5 @@ import { userStorage } from 'src/store/user'
export default function (): void {
const token = userStorage.get()?.token
if (token !== undefined) api.setAuthorizationHeader(token)
if (token !== undefined) api.setSecurityData(token)
}