refactor: fix lint issues
This commit is contained in:
parent
ae4539d679
commit
6bb66be2af
|
|
@ -16,6 +16,7 @@
|
|||
"rules": {
|
||||
"no-undef": "off",
|
||||
"no-unused-vars": "off",
|
||||
"no-labels": "off",
|
||||
"comma-dangle": ["warn", "always-multiline"],
|
||||
"@typescript-eslint/promise-function-async": "off",
|
||||
"@typescript-eslint/strict-boolean-expressions": "off",
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<script lang="ts" setup>
|
||||
import type { AppRouteNames } from 'src/router'
|
||||
import { user } from 'src/store/user'
|
||||
import { computed, defineComponent } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import type { RouteParams } from 'vue-router'
|
||||
|
||||
interface NavLink {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
role="button"
|
||||
aria-label="Delete comment"
|
||||
class="ion-trash-a"
|
||||
@click="$emit('remove-comment')"
|
||||
@click="emit('remove-comment')"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
|
@ -51,7 +51,10 @@ const props = defineProps<{
|
|||
username?: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmit<(e: 'remove-comment') => boolean>()
|
||||
interface Emit {
|
||||
(e: 'remove-comment'): boolean
|
||||
}
|
||||
const emit = defineEmit<Emit>()
|
||||
|
||||
const showRemove = computed(() => (
|
||||
props.username !== undefined && props.username === props.comment.author.username
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
import { render, waitFor } from '@testing-library/vue'
|
||||
import ArticleDetailComment from 'src/components/ArticleDetailComment.vue'
|
||||
import ArticleDetailCommentsForm from 'src/components/ArticleDetailCommentsForm.vue'
|
||||
import registerGlobalComponents from 'src/plugins/global-components'
|
||||
import { router } from 'src/router'
|
||||
import { getCommentsByArticle } from 'src/services/comment/getComments'
|
||||
import { deleteComment } from 'src/services/comment/postComment'
|
||||
import asyncComponentWrapper from 'src/utils/test/async-component-wrapper'
|
||||
import fixtures from 'src/utils/test/fixtures'
|
||||
import { nextTick } from 'vue'
|
||||
import ArticleDetailComments from './ArticleDetailComments.vue'
|
||||
|
||||
jest.mock('src/services/comment/getComments')
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import PopularTags from 'src/components/PopularTags.vue'
|
|||
import { useTags } from 'src/composable/useTags'
|
||||
import registerGlobalComponents from 'src/plugins/global-components'
|
||||
import { router } from 'src/router'
|
||||
import asyncComponentWrapper from 'src/utils/test/async-component-wrapper'
|
||||
import { ref } from 'vue'
|
||||
|
||||
jest.mock('src/composable/useTags')
|
||||
|
|
|
|||
|
|
@ -62,7 +62,8 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { routerPush } from 'src/router'
|
||||
import { postLogin, PostLoginErrors, PostLoginForm } from 'src/services/auth/postLogin'
|
||||
import { postLogin } from 'src/services/auth/postLogin'
|
||||
import type { PostLoginErrors, PostLoginForm } from 'src/services/auth/postLogin'
|
||||
import { updateUser } from 'src/store/user'
|
||||
import { reactive, ref } from 'vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { routerPush } from 'src/router'
|
||||
import { postRegister, PostRegisterErrors, PostRegisterForm } from 'src/services/auth/postRegister'
|
||||
import { postRegister } from 'src/services/auth/postRegister'
|
||||
import type { PostRegisterErrors, PostRegisterForm } from 'src/services/auth/postRegister'
|
||||
import { updateUser } from 'src/store/user'
|
||||
import { reactive, ref } from 'vue'
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { routerPush } from 'src/router'
|
||||
import { putProfile, PutProfileForm } from 'src/services/profile/putProfile'
|
||||
import { putProfile } from 'src/services/profile/putProfile'
|
||||
import type { PutProfileForm } from 'src/services/profile/putProfile'
|
||||
import { checkAuthorization, updateUser, user } from 'src/store/user'
|
||||
import { computed, onMounted, reactive } from 'vue'
|
||||
|
||||
|
|
@ -104,9 +105,9 @@ onMounted(async () => {
|
|||
|
||||
const isButtonDisabled = computed(() => (
|
||||
form.image === user.value?.image &&
|
||||
form.username === user.value?.username &&
|
||||
form.bio === user.value?.bio &&
|
||||
form.email === user.value?.email &&
|
||||
!form.password
|
||||
form.username === user.value?.username &&
|
||||
form.bio === user.value?.bio &&
|
||||
form.email === user.value?.email &&
|
||||
!form.password
|
||||
))
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@
|
|||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noUnusedLocals": true,
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
|
|
|
|||
Loading…
Reference in New Issue