Skip to content

Commit e550e42

Browse files
committed
style: prettier codebase to unify code style
1 parent f0cfcb0 commit e550e42

File tree

129 files changed

+4668
-4391
lines changed

Some content is hidden

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

129 files changed

+4668
-4391
lines changed

.prettierrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"arrowParens": "avoid",
3+
"endOfLine": "auto",
24
"semi": false,
3-
"singleQuote": true
5+
"singleQuote": true,
6+
"trailingComma": "none",
7+
"vueIndentScriptAndStyle": true
48
}

src/.vuepress/components/AppBanner.vue

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -8,91 +8,91 @@
88
</template>
99

1010
<script>
11-
export default {
12-
computed: {
13-
shouldShow() {
14-
if (typeof window === 'undefined') return true
15-
return window.localStorage.getItem('beta-banner-discarded') === null
16-
}
17-
},
11+
export default {
12+
computed: {
13+
shouldShow() {
14+
if (typeof window === 'undefined') return true
15+
return window.localStorage.getItem('beta-banner-discarded') === null
16+
}
17+
},
1818
19-
methods: {
20-
close() {
21-
window.localStorage.setItem('beta-banner-discarded', true)
22-
this.$el.remove()
23-
document.querySelector('html').classList.remove('with-beta-banner')
24-
}
25-
},
19+
methods: {
20+
close() {
21+
window.localStorage.setItem('beta-banner-discarded', true)
22+
this.$el.remove()
23+
document.querySelector('html').classList.remove('with-beta-banner')
24+
}
25+
},
2626
27-
beforeMount() {
28-
if (this.shouldShow) {
29-
document.querySelector('html').classList.add('with-beta-banner')
27+
beforeMount() {
28+
if (this.shouldShow) {
29+
document.querySelector('html').classList.add('with-beta-banner')
30+
}
3031
}
3132
}
32-
}
3333
</script>
3434

3535
<style lang="scss" scoped>
36-
@import '../theme/styles/mixins.scss';
36+
@import '../theme/styles/mixins.scss';
3737
38-
.app-banner {
39-
position: fixed;
40-
z-index: 21;
41-
top: 0;
42-
left: 0;
43-
right: 0;
44-
display: flex;
45-
align-items: center;
46-
justify-content: center;
47-
background-color: #fffedb;
48-
box-sizing: border-box;
49-
border-bottom: 1px solid #eaecef;
50-
text-align: center;
51-
padding: 10px 20px;
52-
box-sizing: border-box;
38+
.app-banner {
39+
position: fixed;
40+
z-index: 21;
41+
top: 0;
42+
left: 0;
43+
right: 0;
44+
display: flex;
45+
align-items: center;
46+
justify-content: center;
47+
background-color: #fffedb;
48+
box-sizing: border-box;
49+
border-bottom: 1px solid #eaecef;
50+
text-align: center;
51+
padding: 10px 20px;
52+
box-sizing: border-box;
5353
54-
p {
55-
margin: 0;
56-
line-height: 1.4;
57-
font-size: 0.7rem;
58-
font-weight: 600;
59-
white-space: nowrap;
60-
overflow: hidden;
61-
text-overflow: ellipsis;
54+
p {
55+
margin: 0;
56+
line-height: 1.4;
57+
font-size: 0.7rem;
58+
font-weight: 600;
59+
white-space: nowrap;
60+
overflow: hidden;
61+
text-overflow: ellipsis;
6262
63-
@include breakpoint(700px) {
64-
font-size: 0.8rem;
63+
@include breakpoint(700px) {
64+
font-size: 0.8rem;
65+
}
6566
}
66-
}
67-
68-
button {
69-
position: absolute;
70-
right: 1.5rem;
71-
border: #f60 1px solid;
72-
background: #f60;
73-
color: #fff;
74-
-webkit-appearance: none;
75-
border-radius: 99px;
76-
cursor: pointer;
77-
line-height: 1.5;
78-
padding: 0 0.5rem;
79-
}
8067
81-
@media only screen and (max-device-width: 541px) {
82-
.hide-sm {
83-
display: none;
68+
button {
69+
position: absolute;
70+
right: 1.5rem;
71+
border: #f60 1px solid;
72+
background: #f60;
73+
color: #fff;
74+
-webkit-appearance: none;
75+
border-radius: 99px;
76+
cursor: pointer;
77+
line-height: 1.5;
78+
padding: 0 0.5rem;
8479
}
8580
86-
p {
87-
flex: 1;
88-
font-size: 0.8rem;
89-
font-weight: normal;
90-
}
81+
@media only screen and (max-device-width: 541px) {
82+
.hide-sm {
83+
display: none;
84+
}
9185
92-
button {
93-
position: relative;
94-
right: 0;
86+
p {
87+
flex: 1;
88+
font-size: 0.8rem;
89+
font-weight: normal;
90+
}
91+
92+
button {
93+
position: relative;
94+
right: 0;
95+
}
9596
}
9697
}
97-
}
9898
</style>

src/.vuepress/components/FirstExample.vue

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@
66
</template>
77

88
<script>
9-
export default {
10-
data() {
11-
return {
12-
counter: 0,
13-
interval: null
9+
export default {
10+
data() {
11+
return {
12+
counter: 0,
13+
interval: null
14+
}
15+
},
16+
methods: {
17+
clearInterval() {
18+
clearInterval(this.interval)
19+
}
20+
},
21+
mounted() {
22+
this.interval = setInterval(() => {
23+
this.counter++
24+
}, 1000)
1425
}
15-
},
16-
methods: {
17-
clearInterval() {
18-
clearInterval(this.interval)
19-
}
20-
},
21-
mounted() {
22-
this.interval = setInterval(() => {
23-
this.counter++
24-
}, 1000)
2526
}
26-
}
2727
</script>
2828

2929
<style lang="scss" scoped>
30-
.demo {
31-
font-family: sans-serif;
32-
border: 1px solid #eee;
33-
border-radius: 2px;
34-
padding: 20px 30px;
35-
margin-top: 1em;
36-
margin-bottom: 40px;
37-
user-select: none;
38-
overflow-x: auto;
39-
}
30+
.demo {
31+
font-family: sans-serif;
32+
border: 1px solid #eee;
33+
border-radius: 2px;
34+
padding: 20px 30px;
35+
margin-top: 1em;
36+
margin-bottom: 40px;
37+
user-select: none;
38+
overflow-x: auto;
39+
}
4040
</style>
Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<script>
2-
const validBadges = {
3-
new: 'new',
4-
breaking: 'breaking',
5-
removed: 'removed',
6-
updated: 'updated'
7-
}
2+
const validBadges = {
3+
new: 'new',
4+
breaking: 'breaking',
5+
removed: 'removed',
6+
updated: 'updated'
7+
}
88
9-
export default {
10-
props: {
11-
badges: {
12-
type: Array,
13-
default: () => [],
14-
validator(value) {
15-
return value.every(badge => Object.keys(validBadges).includes(badge))
9+
export default {
10+
props: {
11+
badges: {
12+
type: Array,
13+
default: () => [],
14+
validator(value) {
15+
return value.every(badge => Object.keys(validBadges).includes(badge))
16+
}
17+
}
18+
},
19+
data() {
20+
return {
21+
validBadges
1622
}
17-
}
18-
},
19-
data() {
20-
return {
21-
validBadges
2223
}
2324
}
24-
}
2525
</script>
2626

2727
<template>
@@ -37,48 +37,48 @@ export default {
3737
</template>
3838

3939
<style lang="scss" scoped>
40-
.migration-badge {
41-
background-color: #ccc;
42-
font-size: 0.8rem;
43-
border: 2px solid #ccc;
44-
border-radius: 5px;
45-
margin-right: 0.5rem;
46-
margin-top: 0.5rem;
47-
color: #222;
48-
padding: 0.25rem 0.25rem;
49-
font-weight: bold;
40+
.migration-badge {
41+
background-color: #ccc;
42+
font-size: 0.8rem;
43+
border: 2px solid #ccc;
44+
border-radius: 5px;
45+
margin-right: 0.5rem;
46+
margin-top: 0.5rem;
47+
color: #222;
48+
padding: 0.25rem 0.25rem;
49+
font-weight: bold;
5050
51-
&:first-child {
52-
margin-left: 1rem;
53-
}
51+
&:first-child {
52+
margin-left: 1rem;
53+
}
5454
55-
&.is-new {
56-
background-color: #228740;
57-
border-color: #228740;
58-
color: #fff;
59-
}
55+
&.is-new {
56+
background-color: #228740;
57+
border-color: #228740;
58+
color: #fff;
59+
}
6060
61-
&.is-breaking {
62-
background-color: #b00000;
63-
border-color: #b00000;
64-
color: #fff;
65-
}
61+
&.is-breaking {
62+
background-color: #b00000;
63+
border-color: #b00000;
64+
color: #fff;
65+
}
6666
67-
&.is-removed {
68-
background-color: #cf8700;
69-
border-color: #cf8700;
70-
color: #fff;
71-
}
67+
&.is-removed {
68+
background-color: #cf8700;
69+
border-color: #cf8700;
70+
color: #fff;
71+
}
7272
73-
&.is-updated {
74-
background-color: #fcff44;
75-
border-color: #fcff44;
76-
color: #222;
73+
&.is-updated {
74+
background-color: #fcff44;
75+
border-color: #fcff44;
76+
color: #222;
77+
}
7778
}
78-
}
7979
80-
.migration-badge-wrapper {
81-
display: flex;
82-
margin-top: -0.5rem;
83-
}
80+
.migration-badge-wrapper {
81+
display: flex;
82+
margin-top: -0.5rem;
83+
}
8484
</style>

0 commit comments

Comments
 (0)