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

fix: lint errors #160

Merged
merged 1 commit into from
Feb 8, 2022
Merged
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ module.exports = {
'no-console': 'off',
'vue/no-v-html': 'off',
},
ignorePatterns: ['functions'],
}
4 changes: 2 additions & 2 deletions components/Actions/TReaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<script>
import firebase from 'firebase/app'
import 'firebase/firestore'
import { useAuth } from '~/use/auth'
import { useDoc } from '~/use/doc'
import {
EyeIcon,
StarIcon,
ArchiveIcon,
EyeOffIcon,
} from '@vue-hero-icons/outline'
import { computed } from 'vue-demi'
import { useAuth } from '~/use/auth'
import { useDoc } from '~/use/doc'

export default {
components: {
Expand Down
2 changes: 1 addition & 1 deletion components/Actions/TReactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div v-else class="flex flex-wrap gap-2 items-center">
<TReaction
:label="$t('TReaction.watch')"
toggledLabel="Watching"
toggled-label="Watching"
field="watch"
icon="EyeIcon"
:item="item"
Expand Down
4 changes: 2 additions & 2 deletions components/Actions/TStars.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div>
<TReaction
:label="$t('TReaction.star')"
toggledLabel="Starred"
toggled-label="Starred"
field="star"
icon="StarIcon"
class="border-none"
Expand Down Expand Up @@ -45,7 +45,7 @@
</TMenu>
<TPopup v-if="showPopup" title="Create list" @close="showPopup = false">
<div class="p-4 space-y-2">
<TField hide-label placeholder="List name" v-model="newListLabel" />
<TField v-model="newListLabel" hide-label placeholder="List name" />
<div class="flex justify-end">
<TButton label="Add" @click="addList" />
</div>
Expand Down
12 changes: 6 additions & 6 deletions components/Card/TCardEvent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ import {
CalendarIcon,
TicketIcon,
} from '@vue-hero-icons/outline'
import { useAuth } from '~/use/auth'
import { computed, onMounted, ref } from 'vue-demi'
import { useAuth } from '~/use/auth'
import { useEvents } from '~/use/events'
import { useDoc } from '~/use/doc'

export default {
components: {
LocationMarkerIcon,
CalendarIcon,
TicketIcon,
},
props: {
node: {
type: Object,
Expand All @@ -53,11 +58,6 @@ export default {
default: false,
},
},
components: {
LocationMarkerIcon,
CalendarIcon,
TicketIcon,
},
methods: {
saveNode(data) {
this.update(this.node.id, data)
Expand Down
2 changes: 1 addition & 1 deletion components/Card/TCardLink.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<component v-if="component" :is="component" :url="url" />
<component :is="component" v-if="component" :url="url" />
<div v-else class="p-4 text-xs text-center">
<a
:href="url"
Expand Down
14 changes: 2 additions & 12 deletions components/Card/TCardPoll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,16 @@
v-for="(answer, key) in node.answers"
:key="`answer-${key}`"
:label="answer"
:toggledLabel="answer"
:toggled-label="answer"
:field="answer"
:item="node"
/>
</div>
</template>

<script>
import {
LocationMarkerIcon,
CalendarIcon,
TicketIcon,
} from '@vue-hero-icons/outline'
import { useAuth } from '~/use/auth'
import { computed, onMounted, ref } from 'vue-demi'
import { useAuth } from '~/use/auth'
import { useDoc } from '~/use/doc'

export default {
Expand All @@ -42,11 +37,6 @@ export default {
default: false,
},
},
components: {
LocationMarkerIcon,
CalendarIcon,
TicketIcon,
},
methods: {
addAnswer() {
this.data.answers.push(this.newAnswer)
Expand Down
2 changes: 1 addition & 1 deletion components/TButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
target="_blank"
rel="noopener noreferrer"
:class="classes"
v-on="$listeners"
:title="title"
v-on="$listeners"
>
<slot>
<div class="flex items-center space-x-2">
Expand Down
2 changes: 1 addition & 1 deletion components/TCommentsInline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<div v-else>
<button
v-if="!showComments"
@click="showComments = true"
class="p-2 text-blue-700 cursor-pointer underline hover:no-underline text-xs text-center mb-2 block w-full"
@click="showComments = true"
>
{{ item.commentsCount || 0 }} comments
</button>
Expand Down
2 changes: 2 additions & 0 deletions components/TDropdownSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
</template>

<script>
import { camelcase } from '~/utils'

export default {
props: {
icon: {
Expand Down
2 changes: 1 addition & 1 deletion components/TForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<TButton v-if="showCopy" label="Copy" @click="copy" />
<slot name="buttons" />
<TButton
:allow-guests="allowGuests"
v-if="submitLabel"
:allow-guests="allowGuests"
type="primary"
:label="submitLabel"
@click="save"
Expand Down
8 changes: 4 additions & 4 deletions components/TInput/TInputArray.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<div>
<component
:is="children.component"
v-for="(item, index) in value"
:key="`${children.component}-${index}`"
:is="children.component"
v-model="internalValue[index]"
v-bind="children"
/>
Expand All @@ -17,9 +17,6 @@

<script>
export default {
data: () => ({
internalValue: [],
}),
props: {
value: {
type: [Array, String],
Expand All @@ -30,6 +27,9 @@ export default {
default: () => ({}),
},
},
data: () => ({
internalValue: [],
}),
watch: {
value(val) {
this.internalValue = val
Expand Down
2 changes: 1 addition & 1 deletion components/TInput/TInputButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<div class="flex flex-nowrap">
<TButton
v-for="option in options"
allow-guests
:key="getValue(option)"
allow-guests
:value="getValue(option)"
:to="option.to"
class="m-1"
Expand Down
2 changes: 1 addition & 1 deletion components/TInput/TInputProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
v-else
v-model="query"
:placeholder="placeholder"
@input="search"
autocomplete="off"
@input="search"
/>
<div
v-if="query"
Expand Down
4 changes: 2 additions & 2 deletions components/TInput/TInputSelectSmall.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
</template>

<script>
import { camelcase } from '~/utils'
import { ChevronDownIcon } from '@vue-hero-icons/outline'
import { camelcase } from '~/utils'

export default {
name: 'TInputSelect',
inheritAttrs: false,
components: {
ChevronDownIcon,
},
inheritAttrs: false,
props: {
options: {
type: Array,
Expand Down
2 changes: 1 addition & 1 deletion components/TPost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<TPreview :excerpt="!show" :content="item.description" />
<div
v-if="item.description && item.description.length > 140"
@click="show = !show"
class="p-2 text-blue-700 cursor-pointer underline hover:no-underline text-xs text-center mb-2"
@click="show = !show"
>
{{ show ? $t('TPost.showLess') : $t('TPost.showMore') }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/TPostList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
</template>

<script>
import { useDocs } from '~/use/docs'
import firebase from 'firebase/app'
import 'firebase/firestore'
import { onUnmounted, watch } from '@nuxtjs/composition-api'
import { useDocs } from '~/use/docs'

export default {
name: 'TPostList',
Expand Down
2 changes: 1 addition & 1 deletion components/TStyles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div>
<NuxtLink
v-for="style in getStyles(value, 0, false, max)"
:to="`/dance/${style.id}`"
:key="style.id"
:to="`/dance/${style.id}`"
:class="getClasses(style)"
>
{{ style.name
Expand Down
6 changes: 3 additions & 3 deletions components/global/WList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export default {
loaded: false,
}
},
async mounted() {
await this.load()
},
methods: {
async load() {
this.id = this.url.replace('https://wedance.vip/lists/', '')
Expand All @@ -47,8 +50,5 @@ export default {
this.loaded = true
},
},
async mounted() {
await this.load()
},
}
</script>
2 changes: 1 addition & 1 deletion components/global/WProfile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
</template>

<script>
import { computed } from 'vue-demi'
import { useDoc } from '~/use/doc'
import { getLabel } from '~/utils'
import { useEvents } from '~/use/events'
import { computed } from 'vue-demi'

export default {
setup(props) {
Expand Down
2 changes: 1 addition & 1 deletion components/global/WTeaser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</div>
<div class="flex justify-center">
<TButton
allow-guests
v-if="button"
allow-guests
class="my-2"
type="primary"
:to="url"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"private": true,
"scripts": {
"dev": "nuxt dev --spa",
"build": "nuxt generate",
"build": "yarn lint && nuxt generate",
"start": "nuxt start",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"test": "jest"
Expand Down
2 changes: 1 addition & 1 deletion pages/demo/date.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<pre>Selected date is - {{ date }}</pre>
<div class="mt-4">
<TField type="datetime-local" v-model="date" label="Select date" />
<TField v-model="date" type="datetime-local" label="Select date" />
</div>
</div>
</template>
Expand Down
4 changes: 2 additions & 2 deletions pages/demo/team.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<template>
<div class="p-4 space-y-4">
<TField
component="TInputProfile"
v-model="single"
component="TInputProfile"
label="Organiser"
label-position="top"
/>

<TField
v-model="multiple"
component="TInputArray"
:children="{
component: 'TInputProfile',
excludeUsernames: multiple
.filter((item) => !!item)
.map((item) => item.username),
}"
v-model="multiple"
label="Team"
label-position="top"
/>
Expand Down
2 changes: 1 addition & 1 deletion pages/feed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
></textarea>
<div class="flex justify-between">
<TInputSelectSmall v-model="postType" :options="postTypeList" />
<TButton @click="send" :title="$t('feed.newMessage.intent')">{{
<TButton :title="$t('feed.newMessage.intent')" @click="send">{{
$t('feed.newMessage.submit')
}}</TButton>
</div>
Expand Down
2 changes: 1 addition & 1 deletion pages/posts/_id/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
:fields="postFields"
vertical
show-cancel
:submit-label="id ? $t('save') :$t('add')"
:submit-label="id ? $t('save') : $t('add')"
class="bg-white p-4 space-y-4"
@save="saveItem"
@cancel="cancelItem"
Expand Down
2 changes: 1 addition & 1 deletion pages/register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<TLoader v-else-if="loading || signingIn" />
<div v-else>
<TForm
allow-guests
v-model="data"
allow-guests
:fields="registerFields"
:field-config="{ labelPosition: 'top' }"
class="space-y-4"
Expand Down
3 changes: 3 additions & 0 deletions plugins/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ if (!process.env.firebase.config?.apiKey) {
throw new Error('Missing Firebase Configuration')
}

// eslint-disable-next-line import/no-mutable-exports
let track = function(...params) {
if (process.env.firebase.analyticsDebug) {
console.log('[track]', ...params)
}
}

// eslint-disable-next-line import/no-mutable-exports
let analytics

// eslint-disable-next-line import/no-mutable-exports
let googleApiKey

if (!firebase.apps.length) {
Expand Down
Loading