Skip to content

Commit da41111

Browse files
chore: standardize linter (#62)
1 parent d7b8f26 commit da41111

File tree

16 files changed

+65
-106
lines changed

16 files changed

+65
-106
lines changed

.github/workflows/test-build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ jobs:
3535
- name: Install dependencies
3636
run: yarn
3737

38+
- name: Run Linter
39+
run: yarn lint
40+
3841
- name: Run build project
3942
run: yarn build

.prettierrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"bracketSpacing": true,
3+
"printWidth": 120,
4+
"singleQuote": true,
25
"semi": false,
3-
"singleQuote": true
4-
}
6+
"trailingComma": "es5"
7+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"build": "gridsome build",
66
"dev": "gridsome develop",
77
"explore": "gridsome explore",
8-
"lint:fix": "eslint --fix --ext .js,.vue --ignore-path .gitignore ."
8+
"lint": "eslint src/**/*.{vue,js}",
9+
"lint:fix": "eslint src/**/*.{vue,js} --fix"
910
},
1011
"dependencies": {
1112
"@gridsome/plugin-google-analytics": "0.1.2",

src/components/Author.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export default {
2727
props: {
2828
showTitle: {
2929
type: Boolean,
30-
default: true
31-
}
32-
}
30+
default: true,
31+
},
32+
},
3333
}
3434
</script>
3535

src/components/PostAuthor.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
{{ post.author.title }}
55
</span>
66
<g-link class="post-author__link" :to="post.author.path">
7-
<g-image
8-
v-if="post.author.avatar"
9-
alt="Author"
10-
class="post-author__avatar"
11-
:src="post.author.avatar"
12-
/>
7+
<g-image v-if="post.author.avatar" alt="Author" class="post-author__avatar" :src="post.author.avatar" />
138
</g-link>
149
</div>
1510
</template>
@@ -19,9 +14,9 @@ export default {
1914
props: {
2015
post: {
2116
type: Object,
22-
default: () => {}
23-
}
24-
}
17+
default: () => {},
18+
},
19+
},
2520
}
2621
</script>
2722

src/components/PostCard.vue

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
<template>
2-
<div
3-
class="post-card content-box"
4-
:class="{ 'post-card--has-poster': post.poster }"
5-
>
2+
<div class="post-card content-box" :class="{ 'post-card--has-poster': post.poster }">
63
<div class="post-card__header">
7-
<g-image
8-
v-if="post.cover_image"
9-
alt="Cover image"
10-
class="post-card__image"
11-
:src="post.cover_image"
12-
/>
4+
<g-image v-if="post.cover_image" alt="Cover image" class="post-card__image" :src="post.cover_image" />
135
</div>
146
<div class="post-card__content">
157
<h2 class="post-card__title" v-html="post.title" />
@@ -30,14 +22,14 @@ import PostTags from '~/components/PostTags'
3022
export default {
3123
components: {
3224
PostMeta,
33-
PostTags
25+
PostTags,
3426
},
3527
props: {
3628
post: {
3729
type: Object,
38-
default: () => {}
39-
}
40-
}
30+
default: () => {},
31+
},
32+
},
4133
}
4234
</script>
4335

src/components/PostMeta.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ import PostAuthor from '~/components/PostAuthor'
1515
1616
export default {
1717
components: {
18-
PostAuthor
18+
PostAuthor,
1919
},
2020
props: {
2121
post: {
2222
type: Object,
23-
default: () => {}
24-
}
25-
}
23+
default: () => {},
24+
},
25+
},
2626
}
2727
</script>
2828

src/components/PostTags.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<template>
22
<div class="post-tags">
3-
<g-link
4-
v-for="tag in post.tags"
5-
:key="tag.id"
6-
class="post-tags__link"
7-
:to="tag.path"
8-
>
3+
<g-link v-for="tag in post.tags" :key="tag.id" class="post-tags__link" :to="tag.path">
94
<span>#</span>
105
{{ tag.title }}
116
</g-link>
@@ -17,9 +12,9 @@ export default {
1712
props: {
1813
post: {
1914
type: Object,
20-
default: () => {}
21-
}
22-
}
15+
default: () => {},
16+
},
17+
},
2318
}
2419
</script>
2520

src/components/SocialLinks.vue

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<template>
22
<div class="social__links">
3-
<a
4-
href="https://www.facebook.com/groups/1675298779418239/"
5-
title="Facebook"
6-
>
3+
<a href="https://www.facebook.com/groups/1675298779418239/" title="Facebook">
74
<svg
85
xmlns="http://www.w3.org/2000/svg"
96
width="24"
@@ -16,9 +13,7 @@
1613
stroke-linejoin="round"
1714
class="feather feather-facebook"
1815
>
19-
<path
20-
d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"
21-
></path>
16+
<path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path>
2217
</svg>
2318
</a>
2419
<a href="https://t.me/vuejsindonesia" title="Telegram">
@@ -71,9 +66,7 @@
7166
>
7267
<circle cx="12" cy="12" r="10"></circle>
7368
<line x1="2" y1="12" x2="22" y2="12"></line>
74-
<path
75-
d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"
76-
></path>
69+
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path>
7770
</svg>
7871
</a>
7972
<a href="https://docs.vuejs.id/" title="Docs">
@@ -96,7 +89,7 @@
9689
</template>
9790
<script>
9891
export default {
99-
name: 'SocialLinks'
92+
name: 'SocialLinks',
10093
}
10194
</script>
10295
<style lang="scss">

src/components/ToggleTheme.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<template>
2-
<button
3-
role="button"
4-
aria-label="Toggle dark/light"
5-
class="toggle-theme"
6-
@click.prevent="toggleTheme"
7-
>
2+
<button role="button" aria-label="Toggle dark/light" class="toggle-theme" @click.prevent="toggleTheme">
83
<svg
94
v-if="darkTheme"
105
xmlns="http://www.w3.org/2000/svg"
@@ -50,7 +45,7 @@
5045
export default {
5146
data() {
5247
return {
53-
darkTheme: false
48+
darkTheme: false,
5449
}
5550
},
5651
mounted() {
@@ -62,8 +57,8 @@ export default {
6257
6358
// This is using a script that is added in index.html
6459
window.__setPreferredTheme(this.darkTheme ? 'dark' : 'light')
65-
}
66-
}
60+
},
61+
},
6762
}
6863
</script>
6964

0 commit comments

Comments
 (0)