Skip to content

Commit b4853c3

Browse files
committed
style: lint code
1 parent ba1f7c7 commit b4853c3

38 files changed

+599
-230
lines changed

packages/@vuepress/core/lib/client/app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Vue.use(VuePress)
3838
Vue.mixin(dataMixin(ClientComputedMixin, siteData))
3939
// component for rendering markdown content and setting title etc.
4040

41+
/* eslint-disable vue/match-component-file-name */
4142
Vue.component('Content', Content)
4243
Vue.component('ContentSlotsDistributor', ContentSlotsDistributor)
4344
Vue.component('OutboundLink', OutboundLink)
@@ -46,6 +47,7 @@ Vue.component('ClientOnly', ClientOnly)
4647
// core components
4748
Vue.component('Layout', getLayoutAsyncComponent('Layout'))
4849
Vue.component('NotFound', getLayoutAsyncComponent('NotFound'))
50+
/* eslint-disable-next-line vue/match-component-file-name */
4951

5052
// global helper for adding base path to absolute urls
5153
Vue.prototype.$withBase = function (path) {
@@ -102,7 +104,7 @@ export function createApp (isServer) {
102104
router,
103105
render (h) {
104106
return h('div', { attrs: { id: 'app' }}, [
105-
h('router-view', { ref: 'layout' }),
107+
h('RouterView', { ref: 'layout' }),
106108
h('div', { class: 'global-ui' }, globalUIComponents.map(component => h(component)))
107109
])
108110
}
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
<template>
2-
<component :is="layout"/>
2+
<component :is="layout" />
33
</template>
44

55
<script>
66
import Vue from 'vue'
77
import { setGlobalInfo } from '@app/util'
88
99
export default {
10+
name: 'GlobalLayout',
11+
12+
computed: {
13+
layout () {
14+
const layout = this.getLayout()
15+
setGlobalInfo('layout', layout)
16+
return Vue.component(layout)
17+
}
18+
},
19+
1020
methods: {
1121
getLayout () {
1222
if (this.$page.path) {
@@ -19,14 +29,6 @@ export default {
1929
}
2030
return 'NotFound'
2131
}
22-
},
23-
24-
computed: {
25-
layout () {
26-
const layout = this.getLayout()
27-
setGlobalInfo('layout', layout)
28-
return Vue.component(layout)
29-
}
3032
}
3133
}
3234
</script>

packages/@vuepress/core/lib/client/components/NotFound.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
<div class="theme-container">
33
<div class="content">
44
<h1>404</h1>
5+
56
<blockquote>{{ getMsg() }}</blockquote>
6-
<router-link to="/">Take me home.</router-link>
7+
8+
<RouterLink to="/">
9+
Take me home.
10+
</RouterLink>
711
</div>
812
</div>
913
</template>

packages/@vuepress/core/lib/client/components/OutboundLink.vue

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
<template functional>
2-
<svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
3-
<path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path>
4-
<polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon>
2+
<svg
3+
class="icon outbound"
4+
xmlns="http://www.w3.org/2000/svg"
5+
aria-hidden="true"
6+
x="0px"
7+
y="0px"
8+
viewBox="0 0 100 100"
9+
width="15"
10+
height="15"
11+
>
12+
<path
13+
fill="currentColor"
14+
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"
15+
/>
16+
<polygon
17+
fill="currentColor"
18+
points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"
19+
/>
520
</svg>
621
</template>
722

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<template>
2-
<Content/>
2+
<Content />
33
</template>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<template>
2-
<Content/>
2+
<Content />
33
</template>

packages/@vuepress/markdown/lib/link.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ module.exports = (md, externalAttrs) => {
6767
routerLinks.push(to)
6868

6969
return Object.create(token, {
70-
tag: { value: 'router-link' }
70+
tag: { value: 'RouterLink' }
7171
})
7272
}
7373

7474
md.renderer.rules.link_close = (tokens, idx, options, env, self) => {
7575
const token = tokens[idx]
7676
if (hasOpenRouterLink) {
77-
token.tag = 'router-link'
77+
token.tag = 'RouterLink'
7878
hasOpenRouterLink = false
7979
}
8080
if (hasOpenExternalLink) {

packages/@vuepress/plugin-back-to-top/BackToTop.vue

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,25 @@
33
<svg
44
v-if="show"
55
class="go-to-top"
6+
xmlns="http://www.w3.org/2000/svg"
7+
viewBox="0 0 49.484 28.284"
68
@click="scrollToTop"
7-
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49.484 28.284"
89
>
910
<g transform="translate(-229 -126.358)">
10-
<rect fill="currentColor" width="35" height="5" rx="2" transform="translate(229 151.107) rotate(-45)"/>
11-
<rect fill="currentColor" width="35" height="5" rx="2" transform="translate(274.949 154.642) rotate(-135)"/>
11+
<rect
12+
fill="currentColor"
13+
width="35"
14+
height="5"
15+
rx="2"
16+
transform="translate(229 151.107) rotate(-45)"
17+
/>
18+
<rect
19+
fill="currentColor"
20+
width="35"
21+
height="5"
22+
rx="2"
23+
transform="translate(274.949 154.642) rotate(-135)"
24+
/>
1225
</g>
1326
</svg>
1427
</transition>
@@ -18,6 +31,8 @@
1831
import debounce from 'lodash.debounce'
1932
2033
export default {
34+
name: 'BackToTop',
35+
2136
props: {
2237
threshold: {
2338
type: Number,
@@ -31,6 +46,12 @@ export default {
3146
}
3247
},
3348
49+
computed: {
50+
show () {
51+
return this.scrollTop > this.threshold
52+
}
53+
},
54+
3455
mounted () {
3556
this.scrollTop = this.getScrollTop()
3657
window.addEventListener('scroll', debounce(() => {
@@ -49,12 +70,6 @@ export default {
4970
window.scrollTo({ top: 0, behavior: 'smooth' })
5071
this.scrollTop = 0
5172
}
52-
},
53-
54-
computed: {
55-
show () {
56-
return this.scrollTop > this.threshold
57-
}
5873
}
5974
}
6075
</script>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import BackToTop from './BackToTop.vue'
22

33
export default ({ Vue }) => {
4+
// eslint-disable-next-line vue/match-component-file-name
45
Vue.component('BackToTop', BackToTop)
56
}

packages/@vuepress/plugin-pwa/lib/SWUpdatePopup.vue

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
v-if="enabled"
1111
class="sw-update-popup"
1212
>
13-
{{ message }}<br>
14-
<button @click="reload">{{ buttonText }}</button>
13+
{{ message }}
14+
15+
<br>
16+
17+
<button @click="reload">
18+
{{ buttonText }}
19+
</button>
1520
</div>
1621
</slot>
1722
</transition>
@@ -24,20 +29,15 @@ import { normalizeConfig } from '@app/util'
2429
import { popupConfig as defaultPopupConfig } from './i18n'
2530
2631
export default {
32+
name: 'SWUpdatePopup',
33+
2734
data () {
2835
return {
2936
rawPopupConfig: SW_UPDATE_POPUP,
3037
updateEvent: null
3138
}
3239
},
3340
34-
created () {
35-
event.$on('sw-updated', this.onSWUpdated)
36-
if (SW_UPDATE_POPUP === true) {
37-
this.rawPopupConfig = defaultPopupConfig
38-
}
39-
},
40-
4141
computed: {
4242
popupConfig () {
4343
return normalizeConfig(this, this.rawPopupConfig)
@@ -58,6 +58,13 @@ export default {
5858
}
5959
},
6060
61+
created () {
62+
event.$on('sw-updated', this.onSWUpdated)
63+
if (SW_UPDATE_POPUP === true) {
64+
this.rawPopupConfig = defaultPopupConfig
65+
}
66+
},
67+
6168
methods: {
6269
onSWUpdated (e) {
6370
this.updateEvent = e

0 commit comments

Comments
 (0)