Skip to content

Commit c9ac4a3

Browse files
Resul AvanResul Avan
Resul Avan
authored and
Resul Avan
committed
eslint fixes
1 parent 3916efa commit c9ac4a3

File tree

110 files changed

+1727
-1859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1727
-1859
lines changed

src/.eslintrc.js

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
module.exports = {
22
root: true,
3-
parser: 'babel-eslint',
43
env: {
5-
browser: true,
4+
es6: true,
65
node: true,
6+
browser: true
7+
},
8+
parserOptions: {
9+
parser: 'babel-eslint',
10+
sourceType: 'module',
11+
ecmaFeatures: {
12+
legacyDecorators: true
13+
},
14+
ecmaVersion: 6
715
},
816
extends: [
9-
// '@nuxtjs/eslint-config-typescript',
10-
'prettier',
11-
'prettier/vue',
12-
'plugin:prettier/recommended',
13-
'plugin:nuxt/recommended',
17+
'@nuxtjs/eslint-config-typescript'
1418
],
15-
plugins: ['prettier'],
16-
// add your custom rules here
17-
rules: {},
19+
rules: {
20+
'no-console': 'off',
21+
indent: 2
22+
}
1823
}

src/components/Loading.vue

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
<template>
2-
<div id="wave" v-if="loading">
3-
<span class="dot olive"></span>
4-
<span class="dot blue"></span>
5-
<span class="dot green"></span>
6-
<span class="dot red"></span>
2+
<div v-if="loading" id="wave">
3+
<span class="dot olive" />
4+
<span class="dot blue" />
5+
<span class="dot green" />
6+
<span class="dot red" />
77
</div>
88
</template>
99

1010
<script lang="ts">
1111
12-
import { Component, Vue } from 'nuxt-property-decorator';
13-
import { StateNamespace } from "~/types";
12+
import { Component, Vue } from 'nuxt-property-decorator'
13+
import { StateNamespace } from '~/types'
1414
1515
@Component({
1616
components: {}
1717
})
18-
export default class extends Vue {
19-
@StateNamespace.loading.Getter loading !: boolean
20-
@StateNamespace.loading.Action saveLoading !: (loading: boolean) => Promise<void>
18+
export default class extends Vue {
19+
@StateNamespace.loading.Getter loading : boolean
20+
@StateNamespace.loading.Action saveLoading : (loading: boolean) => Promise<void>
2121
22-
start() {
22+
start () {
2323
this.saveLoading(true)
2424
}
2525
26-
finish() {
26+
finish () {
2727
this.saveLoading(false)
2828
}
2929
30-
fail(error: Error) {
30+
fail (error: Error) {
3131
console.log('loading.error', error)
3232
}
3333
34-
increase(num: Number) {
34+
increase (num: Number) {
3535
console.log('loading.num: ', num)
3636
}
3737
}

src/components/card/ProfileCard.vue

+36-29
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,74 @@
11
<template>
2-
<div class="card has-cursor-pointer has-margin-bottom-25"
3-
@click="gotoProfile(username)">
4-
5-
<BackgroundImage v-if="!!coverPhoto" :image-url="coverImageUrl" :height="coverPhotoHeight"/>
2+
<div
3+
class="card has-cursor-pointer has-margin-bottom-25"
4+
@click="gotoProfile(username)"
5+
>
6+
<BackgroundImage v-if="!!coverPhoto" :image-url="coverImageUrl" :height="coverPhotoHeight" />
67

78
<div class="card-content">
89
<div class="media">
910
<div class="media-left">
10-
<BackgroundSquareImage :image-url="profileImageUrl" :size="profilePhotoSize" rounded="true"
11-
border-inside="true"
12-
border="3"/>
11+
<BackgroundSquareImage
12+
:image-url="profileImageUrl"
13+
:size="profilePhotoSize"
14+
rounded="true"
15+
border-inside="true"
16+
border="3"
17+
/>
1318
</div>
1419
<div class="media-content">
15-
<p class="title is-4">{{fullName}}</p>
16-
<p class="subtitle is-6">@{{username}}</p>
20+
<p class="title is-4">
21+
{{ fullName }}
22+
</p>
23+
<p class="subtitle is-6">
24+
@{{ username }}
25+
</p>
1726
</div>
1827
</div>
1928
</div>
2029
</div>
2130
</template>
2231

2332
<script lang="ts">
24-
import { Component, Prop, Vue } from 'nuxt-property-decorator';
25-
import { DefaultCoverPhoto, DefaultProfilePhoto, Image, PrivacyType, Routes } from '../../types';
26-
import { getUserRoute } from '~/service/global-service';
27-
import BackgroundSquareImage from '../image/BackgroundSquareImage.vue';
28-
import BackgroundImage from '~/components/image/BackgroundImage.vue';
33+
import { Component, Prop, Vue } from 'nuxt-property-decorator'
34+
import { DefaultCoverPhoto, DefaultProfilePhoto, Image, PrivacyType, Routes } from '../../types'
35+
import BackgroundSquareImage from '../image/BackgroundSquareImage.vue'
36+
import { getUserRoute } from '~/service/global-service'
37+
import BackgroundImage from '~/components/image/BackgroundImage.vue'
2938
3039
@Component({
3140
components: { BackgroundImage, BackgroundSquareImage }
3241
})
33-
export default class ProfileCard extends Vue {
34-
35-
@Prop({ type: String, required: true }) name !: string
36-
@Prop({ type: String, required: true }) username !: string
37-
@Prop({ type: String, required: true }) privacyType !: PrivacyType
38-
@Prop({ type: Object, required: true }) profilePhoto !: Image
39-
@Prop({ type: Object, required: false }) coverPhoto !: Image
40-
@Prop({ type: Number, required: false, default: 250 }) coverPhotoHeight !: number
41-
@Prop({ type: Number, required: false, default: 64 }) profilePhotoSize !: number
42+
export default class ProfileCard extends Vue {
43+
@Prop({ type: String, required: true }) name:string
44+
@Prop({ type: String, required: true }) username:string
45+
@Prop({ type: String, required: true }) privacyType:PrivacyType
46+
@Prop({ type: Object, required: true }) profilePhoto:Image
47+
@Prop({ type: Object, required: false }) coverPhoto:Image
48+
@Prop({ type: Number, required: false, default: 250 }) coverPhotoHeight:number
49+
@Prop({ type: Number, required: false, default: 64 }) profilePhotoSize:number
4250
43-
get isPrivate() {
51+
get isPrivate () {
4452
return this.privacyType === PrivacyType.PRIVATE
4553
}
4654
47-
get coverImageUrl() {
55+
get coverImageUrl () {
4856
return this.isPrivate ? DefaultCoverPhoto.src : this.coverPhoto?.src
4957
}
5058
51-
get profileImageUrl() {
59+
get profileImageUrl () {
5260
return this.isPrivate ? DefaultProfilePhoto.src : this.profilePhoto?.src
5361
}
5462
55-
get fullName() {
63+
get fullName () {
5664
return this.isPrivate ? 'private account' : this.name
5765
}
5866
59-
async gotoProfile(username: string) {
67+
async gotoProfile (username: string) {
6068
if (this.isPrivate) {
6169
return
6270
}
6371
await this.$router.push(getUserRoute(Routes.PROFILE_DYNAMIC, username))
6472
}
65-
6673
}
6774
</script>

src/components/card/ProviderCard.vue

+39-36
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
<template>
22
<div class="box has-text-centered">
3-
43
<b-field :label="getProviderLabel(providerConfig.providerType)" horizontal>
54
<b-tooltip
65
:label="getTooltip(providerConfig.providerType)"
76
:type="isLinked ? 'is-light': 'is-success'"
87
class="has-margin-top-10 has-margin-bottom-15 is-fullwidth"
9-
multilined>
10-
11-
<b-button :type="isLinked ? providerConfig.colorType: defaultType" :icon-pack="providerConfig.iconPack"
12-
:class="isLinked ? '' : 'has-text-black'"
13-
:icon-right="providerConfig.icon" @click="submit" outlined expanded>
14-
<span
15-
class="has-margin-right-5"> {{ isLinked ? $t('provider.submit.unlink') : $t('provider.submit.link') }}
16-
</span>
8+
multilined
9+
>
10+
<b-button
11+
:type="isLinked ? providerConfig.colorType: defaultType"
12+
:icon-pack="providerConfig.iconPack"
13+
:class="isLinked ? '' : 'has-text-black'"
14+
:icon-right="providerConfig.icon"
15+
outlined
16+
expanded
17+
@click="submit"
18+
>
19+
<span
20+
class="has-margin-right-5"
21+
> {{ isLinked ? $t('provider.submit.unlink') : $t('provider.submit.link') }}
22+
</span>
1723
</b-button>
1824
</b-tooltip>
1925
</b-field>
@@ -24,7 +30,7 @@
2430
</b-field>
2531

2632
<b-field :label="$t('common.field.photo')" horizontal>
27-
<BackgroundSquareImage :image-url="imageUrl" size="64" auto-margin="true"/>
33+
<BackgroundSquareImage :image-url="imageUrl" size="64" auto-margin="true" />
2834
</b-field>
2935

3036
<b-field :label="$t('common.field.name')" horizontal>
@@ -39,60 +45,57 @@
3945
<span>{{ providerData.phoneNumber }}</span>
4046
</b-field>
4147
</template>
42-
4348
</div>
4449
</template>
4550

4651
<script lang="ts">
47-
import { Component, Prop, Vue } from 'nuxt-property-decorator';
48-
import { DefaultProfilePhoto, ProviderConfig, ProviderData, ProviderType } from '~/types';
49-
import BackgroundSquareImage from '~/components/image/BackgroundSquareImage.vue';
52+
import { Component, Prop, Vue } from 'nuxt-property-decorator'
53+
import { DefaultProfilePhoto, ProviderConfig, ProviderData, ProviderType } from '~/types'
54+
import BackgroundSquareImage from '~/components/image/BackgroundSquareImage.vue'
5055
5156
@Component({
5257
components: { BackgroundSquareImage }
5358
})
54-
export default class ProviderCard extends Vue {
55-
59+
export default class ProviderCard extends Vue {
5660
defaultType = 'is-light';
5761
58-
@Prop({ type: Object, required: true }) providerConfig !: ProviderConfig;
59-
@Prop({ type: Boolean, required: true }) isLinked !: boolean;
60-
@Prop({ type: Function, required: true }) linkFunction !: (providerType: ProviderType) => void;
61-
@Prop({ type: Object, required: false }) providerData !: ProviderData;
62+
@Prop({ type: Object, required: true }) providerConfig: ProviderConfig;
63+
@Prop({ type: Boolean, required: true }) isLinked: boolean;
64+
@Prop({ type: Function, required: true }) linkFunction: (providerType: ProviderType) => void;
65+
@Prop({ type: Object, required: false }) providerData: ProviderData;
6266
63-
submit() {
67+
submit () {
6468
if (!this.isLinked) {
65-
this.linkFunction(this.providerConfig.providerType);
66-
return;
69+
this.linkFunction(this.providerConfig.providerType)
70+
return
6771
}
6872
69-
let provider = this.providerConfig.providerType.replace('.com', '')
73+
const provider = this.providerConfig.providerType.replace('.com', '')
7074
7175
this.$buefy.dialog.confirm({
72-
title: this.$t('provider.dialog.delete.title', { provider }) as string,
73-
message: this.$t('provider.dialog.delete.message', { provider }) as string,
74-
confirmText: this.$t('provider.dialog.delete.confirm') as string,
75-
cancelText: this.$t('common.cancel') as string,
76+
title: this.$t('provider.dialog.delete.title', { provider }) + '',
77+
message: this.$t('provider.dialog.delete.message', { provider }) + '',
78+
confirmText: this.$t('provider.dialog.delete.confirm') + '',
79+
cancelText: this.$t('common.cancel') + '',
7680
type: 'is-danger',
7781
hasIcon: true,
7882
onConfirm: () => this.linkFunction(this.providerConfig.providerType)
7983
})
8084
}
8185
82-
getTooltip(providerType: ProviderType) {
83-
let provider = providerType.replace('.com', '');
84-
return this.isLinked ?
85-
this.$t('provider.tooltip.linkedProvider', { provider }) :
86-
this.$t('provider.tooltip.unlinkedProvider', { provider });
86+
getTooltip (providerType: ProviderType) {
87+
const provider = providerType.replace('.com', '')
88+
return this.isLinked
89+
? this.$t('provider.tooltip.linkedProvider', { provider })
90+
: this.$t('provider.tooltip.unlinkedProvider', { provider })
8791
}
8892
89-
getProviderLabel(providerType: ProviderType) {
93+
getProviderLabel (providerType: ProviderType) {
9094
return this.$t('provider.label.' + providerType)
9195
}
9296
93-
get imageUrl() {
97+
get imageUrl () {
9498
return this.providerData.photoURL || DefaultProfilePhoto.src
9599
}
96-
97100
}
98101
</script>

src/components/error/Error403.vue

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
<template>
22
<div>
3-
<pre>{{ error}}</pre>
3+
<pre>{{ error }}</pre>
44
</div>
55
</template>
66

77
<script lang="ts">
8-
import { Component, Prop, Vue } from 'nuxt-property-decorator';
9-
import { NuxtError } from '@nuxt/types';
8+
import { Component, Prop, Vue } from 'nuxt-property-decorator'
9+
import { NuxtError } from '@nuxt/types'
1010
1111
@Component({
1212
components: {}
1313
})
14-
export default class Error403 extends Vue {
15-
16-
@Prop({ required: true }) error !: NuxtError
17-
14+
export default class Error403 extends Vue {
15+
@Prop({ required: true }) error:NuxtError
1816
}
1917
</script>

src/components/error/Error404.vue

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<template>
2-
<pre>{{ error}}</pre>
2+
<pre>{{ error }}</pre>
33
</template>
44

55
<script lang="ts">
6-
import { Component, Prop, Vue } from 'nuxt-property-decorator';
7-
import { NuxtError } from '@nuxt/types';
6+
import { Component, Prop, Vue } from 'nuxt-property-decorator'
7+
import { NuxtError } from '@nuxt/types'
88
99
@Component({
1010
components: {}
1111
})
12-
export default class Error404 extends Vue {
13-
14-
@Prop({ required: true }) error !: NuxtError
15-
12+
export default class Error404 extends Vue {
13+
@Prop({ required: true }) error:NuxtError
1614
}
1715
</script>

src/components/error/Error500.vue

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
<template>
22
<div>
3-
<pre>{{ error}}</pre>
3+
<pre>{{ error }}</pre>
44
</div>
55
</template>
66

77
<script lang="ts">
8-
import { Component, Prop, Vue } from 'nuxt-property-decorator';
9-
import { NuxtError } from '@nuxt/types';
8+
import { Component, Prop, Vue } from 'nuxt-property-decorator'
9+
import { NuxtError } from '@nuxt/types'
1010
1111
@Component({
1212
components: {}
1313
})
14-
export default class Error500 extends Vue {
15-
16-
@Prop({ required: true }) error !: NuxtError
17-
14+
export default class Error500 extends Vue {
15+
@Prop({ required: true }) error:NuxtError
1816
}
1917
</script>

0 commit comments

Comments
 (0)