Skip to content

Commit 48ca07a

Browse files
committed
style: lint the codebase
1 parent 6e92fdb commit 48ca07a

File tree

8 files changed

+86
-89
lines changed

8 files changed

+86
-89
lines changed

packages/@vuepress/core/lib/node/__tests__/prepare/Page.spec.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,13 @@ describe('Page', () => {
140140

141141
test('should log when enhancing when failing', async () => {
142142
const error = { errorMessage: 'this is an error message' }
143-
expect.assertions(1)
144-
try {
145-
await page.enhance([{
146-
pluginName: 'error-plugin',
147-
value: jest.fn().mockRejectedValue(error)
148-
}])
149-
} catch (e) {
150-
expect(console.log).toHaveBeenCalledWith(error)
151-
}
143+
144+
await expect(page.enhance([{
145+
pluginName: 'error-plugin',
146+
value: jest.fn().mockRejectedValue(error)
147+
}])).rejects.toThrow()
148+
149+
expect(console.log).toHaveBeenCalledWith(error)
152150
})
153151
})
154152
})
155-

packages/@vuepress/core/lib/node/__tests__/prepare/fixtures/docs-i18n/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = {
2727
label: '简体中文',
2828
selectText: '选择语言',
2929
editLinkText: '在 GitHub 上编辑此页',
30-
lastUpdated: '上次更新',
30+
lastUpdated: '上次更新'
3131
}
3232
}
3333
}

packages/@vuepress/test-utils/lib/createJestRunner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = function createJestRunner (jestArgs) {
1818
function getChildProcesExecArgv () {
1919
const execArgv = process.execArgv.slice(0)
2020
const inspectArgvIndex = execArgv.findIndex(argv =>
21-
argv.includes('--inspect-brk'),
21+
argv.includes('--inspect-brk')
2222
)
2323

2424
if (inspectArgvIndex > -1) {

packages/docs/docs/.vuepress/components/UpgradePath.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
export default {
33
functional: true,
44
props: {
5-
title: String,
6-
required: true
5+
title: {
6+
type: String,
7+
required: true
8+
}
79
},
810
render (h, { props, slots }) {
911
return h('div',

packages/docs/docs/.vuepress/components/diagram-markdown-slot-relationship.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,3 @@
4545
</svg>
4646
</svg-container>
4747
</template>
48-
49-

packages/docs/docs/.vuepress/config.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ module.exports = ctx => ({
4848
'/api/': getApiSidebar(),
4949
'/guide/': getGuideSidebar('Guide', 'Advanced'),
5050
'/plugin/': getPluginSidebar('Plugin', 'Introduction', 'Official Plugins'),
51-
'/theme/': getThemeSidebar('Theme', 'Introduction'),
51+
'/theme/': getThemeSidebar('Theme', 'Introduction')
5252
}
5353
},
5454
'/zh/': {
5555
label: '简体中文',
5656
selectText: '选择语言',
57-
ariaLabel: "选择语言",
57+
ariaLabel: '选择语言',
5858
editLinkText: '在 GitHub 上编辑此页',
5959
lastUpdated: '上次更新',
6060
nav: require('./nav/zh'),
@@ -80,18 +80,18 @@ module.exports = ctx => ({
8080
['container', {
8181
type: 'vue',
8282
before: '<pre class="vue-container"><code>',
83-
after: '</code></pre>',
83+
after: '</code></pre>'
8484
}],
8585
['container', {
8686
type: 'upgrade',
8787
before: info => `<UpgradePath title="${info}">`,
88-
after: '</UpgradePath>',
88+
after: '</UpgradePath>'
8989
}],
90-
['flowchart'],
90+
['flowchart']
9191
],
9292
extraWatchFiles: [
9393
'.vuepress/nav/en.js',
94-
'.vuepress/nav/zh.js',
94+
'.vuepress/nav/zh.js'
9595
]
9696
})
9797

@@ -116,7 +116,7 @@ function getGuideSidebar (groupA, groupB) {
116116
'markdown',
117117
'using-vue',
118118
'i18n',
119-
'deploy',
119+
'deploy'
120120
]
121121
},
122122
{
@@ -154,7 +154,7 @@ function getPluginSidebar (pluginTitle, pluginIntro, officialPluginTitle) {
154154
{
155155
title: officialPluginTitle,
156156
collapsable: false,
157-
children: officalPlugins,
157+
children: officalPlugins
158158
}
159159
]
160160
}
@@ -173,6 +173,6 @@ function getThemeSidebar (groupA, introductionA) {
173173
'default-theme-config',
174174
'inheritance'
175175
]
176-
},
176+
}
177177
]
178178
}
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
11
module.exports = [
22
{
3-
text: "Guide",
4-
link: "/guide/"
3+
text: 'Guide',
4+
link: '/guide/'
55
},
66
{
7-
text: "Config Reference",
8-
link: "/config/"
7+
text: 'Config Reference',
8+
link: '/config/'
99
},
1010
{
11-
text: "Plugin",
12-
link: "/plugin/"
11+
text: 'Plugin',
12+
link: '/plugin/'
1313
},
1414
{
15-
text: "Theme",
16-
link: "/theme/"
15+
text: 'Theme',
16+
link: '/theme/'
1717
},
1818
{
19-
text: "Learn More",
20-
ariaLabel: "Learn More",
19+
text: 'Learn More',
20+
ariaLabel: 'Learn More',
2121
items: [
2222
{
23-
text: "API",
23+
text: 'API',
2424
items: [
2525
{
26-
text: "CLI",
27-
link: "/api/cli.html"
26+
text: 'CLI',
27+
link: '/api/cli.html'
2828
},
2929
{
30-
text: "Node",
31-
link: "/api/node.html"
30+
text: 'Node',
31+
link: '/api/node.html'
3232
}
3333
]
3434
},
3535
{
36-
text: "Contributing Guide",
36+
text: 'Contributing Guide',
3737
items: [
3838
{
39-
text: "Local Development",
40-
link: "/miscellaneous/local-development.html"
39+
text: 'Local Development',
40+
link: '/miscellaneous/local-development.html'
4141
},
4242
{
43-
text: "Design Concepts",
44-
link: "/miscellaneous/design-concepts.html"
43+
text: 'Design Concepts',
44+
link: '/miscellaneous/design-concepts.html'
4545
},
4646
{
47-
text: "FAQ",
48-
link: "/faq/"
47+
text: 'FAQ',
48+
link: '/faq/'
4949
},
5050
{
51-
text: "Glossary",
52-
link: "/miscellaneous/glossary.html"
51+
text: 'Glossary',
52+
link: '/miscellaneous/glossary.html'
5353
}
5454
]
5555
},
5656
{
57-
text: "Miscellaneous",
57+
text: 'Miscellaneous',
5858
items: [
5959
{
60-
text: "Migrate from 0.x",
61-
link: "/miscellaneous/migration-guide.html"
60+
text: 'Migrate from 0.x',
61+
link: '/miscellaneous/migration-guide.html'
6262
},
6363
{
64-
text: "Changelog",
65-
link: "https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md"
64+
text: 'Changelog',
65+
link: 'https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md'
6666
}
6767
]
6868
}
6969
]
7070
},
7171
{
72-
text: "0.x",
73-
link: "https://v0.vuepress.vuejs.org/"
72+
text: '0.x',
73+
link: 'https://v0.vuepress.vuejs.org/'
7474
}
75-
];
75+
]
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
11
module.exports = [
22
{
3-
text: "指南",
4-
link: "/zh/guide/"
3+
text: '指南',
4+
link: '/zh/guide/'
55
},
66
{
7-
text: "配置",
8-
link: "/zh/config/"
7+
text: '配置',
8+
link: '/zh/config/'
99
},
1010
{
11-
text: "插件",
12-
link: "/zh/plugin/"
11+
text: '插件',
12+
link: '/zh/plugin/'
1313
},
1414
{
15-
text: "主题",
16-
link: "/zh/theme/"
15+
text: '主题',
16+
link: '/zh/theme/'
1717
},
1818
{
19-
text: "了解更多",
20-
ariaLabel: "了解更多",
19+
text: '了解更多',
20+
ariaLabel: '了解更多',
2121
items: [
2222
{
23-
text: "API",
23+
text: 'API',
2424
items: [
2525
{
26-
text: "CLI",
27-
link: "/zh/api/cli.html"
26+
text: 'CLI',
27+
link: '/zh/api/cli.html'
2828
},
2929
{
30-
text: "Node",
31-
link: "/zh/api/node.html"
30+
text: 'Node',
31+
link: '/zh/api/node.html'
3232
}
3333
]
3434
},
3535
{
36-
text: "开发指南",
36+
text: '开发指南',
3737
items: [
3838
{
39-
text: "本地开发",
40-
link: "/zh/miscellaneous/local-development.html"
39+
text: '本地开发',
40+
link: '/zh/miscellaneous/local-development.html'
4141
},
4242
{
43-
text: "设计理念",
44-
link: "/zh/miscellaneous/design-concepts.html"
43+
text: '设计理念',
44+
link: '/zh/miscellaneous/design-concepts.html'
4545
},
4646
{
47-
text: "FAQ",
48-
link: "/zh/faq/"
47+
text: 'FAQ',
48+
link: '/zh/faq/'
4949
},
5050
{
51-
text: "术语",
52-
link: "/zh/miscellaneous/glossary.html"
51+
text: '术语',
52+
link: '/zh/miscellaneous/glossary.html'
5353
}
5454
]
5555
},
5656
{
57-
text: "其他",
57+
text: '其他',
5858
items: [
5959
{
60-
text: "从 0.x 迁移",
61-
link: "/zh/miscellaneous/migration-guide.html"
60+
text: '从 0.x 迁移',
61+
link: '/zh/miscellaneous/migration-guide.html'
6262
},
6363
{
64-
text: "Changelog",
65-
link: "https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md"
64+
text: 'Changelog',
65+
link: 'https://github.com/vuejs/vuepress/blob/master/CHANGELOG.md'
6666
}
6767
]
6868
}
6969
]
7070
},
7171
{
72-
text: "0.x",
73-
link: "https://v0.vuepress.vuejs.org/"
72+
text: '0.x',
73+
link: 'https://v0.vuepress.vuejs.org/'
7474
}
75-
];
75+
]

0 commit comments

Comments
 (0)