refactor: fix lint issues

This commit is contained in:
mutoe 2021-04-24 18:26:47 +08:00
parent ae4539d679
commit 6bb66be2af
No known key found for this signature in database
GPG Key ID: ABE5E78D073FC208
9 changed files with 19 additions and 15 deletions

View File

@ -16,6 +16,7 @@
"rules": { "rules": {
"no-undef": "off", "no-undef": "off",
"no-unused-vars": "off", "no-unused-vars": "off",
"no-labels": "off",
"comma-dangle": ["warn", "always-multiline"], "comma-dangle": ["warn", "always-multiline"],
"@typescript-eslint/promise-function-async": "off", "@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/strict-boolean-expressions": "off", "@typescript-eslint/strict-boolean-expressions": "off",

View File

@ -34,7 +34,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { AppRouteNames } from 'src/router' import type { AppRouteNames } from 'src/router'
import { user } from 'src/store/user' import { user } from 'src/store/user'
import { computed, defineComponent } from 'vue' import { computed } from 'vue'
import type { RouteParams } from 'vue-router' import type { RouteParams } from 'vue-router'
interface NavLink { interface NavLink {

View File

@ -36,7 +36,7 @@
role="button" role="button"
aria-label="Delete comment" aria-label="Delete comment"
class="ion-trash-a" class="ion-trash-a"
@click="$emit('remove-comment')" @click="emit('remove-comment')"
/> />
</span> </span>
</div> </div>
@ -51,7 +51,10 @@ const props = defineProps<{
username?: string username?: string
}>() }>()
const emit = defineEmit<(e: 'remove-comment') => boolean>() interface Emit {
(e: 'remove-comment'): boolean
}
const emit = defineEmit<Emit>()
const showRemove = computed(() => ( const showRemove = computed(() => (
props.username !== undefined && props.username === props.comment.author.username props.username !== undefined && props.username === props.comment.author.username

View File

@ -1,13 +1,10 @@
import { render, waitFor } from '@testing-library/vue' 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 registerGlobalComponents from 'src/plugins/global-components'
import { router } from 'src/router' import { router } from 'src/router'
import { getCommentsByArticle } from 'src/services/comment/getComments' import { getCommentsByArticle } from 'src/services/comment/getComments'
import { deleteComment } from 'src/services/comment/postComment' import { deleteComment } from 'src/services/comment/postComment'
import asyncComponentWrapper from 'src/utils/test/async-component-wrapper' import asyncComponentWrapper from 'src/utils/test/async-component-wrapper'
import fixtures from 'src/utils/test/fixtures' import fixtures from 'src/utils/test/fixtures'
import { nextTick } from 'vue'
import ArticleDetailComments from './ArticleDetailComments.vue' import ArticleDetailComments from './ArticleDetailComments.vue'
jest.mock('src/services/comment/getComments') jest.mock('src/services/comment/getComments')

View File

@ -3,7 +3,6 @@ import PopularTags from 'src/components/PopularTags.vue'
import { useTags } from 'src/composable/useTags' import { useTags } from 'src/composable/useTags'
import registerGlobalComponents from 'src/plugins/global-components' import registerGlobalComponents from 'src/plugins/global-components'
import { router } from 'src/router' import { router } from 'src/router'
import asyncComponentWrapper from 'src/utils/test/async-component-wrapper'
import { ref } from 'vue' import { ref } from 'vue'
jest.mock('src/composable/useTags') jest.mock('src/composable/useTags')

View File

@ -62,7 +62,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { routerPush } from 'src/router' 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 { updateUser } from 'src/store/user'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'

View File

@ -69,7 +69,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { routerPush } from 'src/router' 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 { updateUser } from 'src/store/user'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'

View File

@ -75,7 +75,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { routerPush } from 'src/router' 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 { checkAuthorization, updateUser, user } from 'src/store/user'
import { computed, onMounted, reactive } from 'vue' import { computed, onMounted, reactive } from 'vue'
@ -104,9 +105,9 @@ onMounted(async () => {
const isButtonDisabled = computed(() => ( const isButtonDisabled = computed(() => (
form.image === user.value?.image && form.image === user.value?.image &&
form.username === user.value?.username && form.username === user.value?.username &&
form.bio === user.value?.bio && form.bio === user.value?.bio &&
form.email === user.value?.email && form.email === user.value?.email &&
!form.password !form.password
)) ))
</script> </script>

View File

@ -11,7 +11,8 @@
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true, "skipLibCheck": true,
"forceConsistentCasingInFileNames": true "forceConsistentCasingInFileNames": true,
"noUnusedLocals": true,
}, },
"include": [ "include": [
"src" "src"