Skip to content

Commit 7d80137

Browse files
committed
style: format code
1 parent a63667b commit 7d80137

File tree

202 files changed

+443
-435
lines changed

Some content is hidden

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

202 files changed

+443
-435
lines changed

.commitlintrc.cjs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
const fs = require('fs')
22
const path = require('path')
33

4-
const getSubDirectories = (dir) => fs.readdirSync(dir).filter(item => fs.statSync(path.join(dir, item)).isDirectory())
4+
const getSubDirectories = (dir) =>
5+
fs
6+
.readdirSync(dir)
7+
.filter((item) => fs.statSync(path.join(dir, item)).isDirectory())
58
const corePackages = getSubDirectories(path.resolve(__dirname, 'packages'))
6-
const ecosystemPackages = getSubDirectories(path.resolve(__dirname, 'ecosystem'))
9+
const ecosystemPackages = getSubDirectories(
10+
path.resolve(__dirname, 'ecosystem'),
11+
)
712

813
module.exports = {
914
extends: ['@commitlint/config-conventional'],
1015
rules: {
11-
'scope-enum': [
12-
2,
13-
'always',
14-
[...corePackages, ...ecosystemPackages],
15-
],
16+
'scope-enum': [2, 'always', [...corePackages, ...ecosystemPackages]],
1617
'footer-max-line-length': [0],
1718
},
1819
}

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
pnpm-lock.yaml
2+
*.html
3+
*.md

docs/.vuepress/components/NpmBadge.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const props = defineProps({
1414
})
1515
1616
const badgeLink = computed(
17-
() => `https://www.npmjs.com/package/${props.package}`
17+
() => `https://www.npmjs.com/package/${props.package}`,
1818
)
1919
const badgeLabel = computed(() => {
2020
if (props.distTag) {
@@ -26,7 +26,7 @@ const badgeImg = computed(
2626
() =>
2727
`https://badgen.net/npm/v/${props.package}/${
2828
props.distTag
29-
}?label=${encodeURIComponent(badgeLabel.value)}`
29+
}?label=${encodeURIComponent(badgeLabel.value)}`,
3030
)
3131
</script>
3232

docs/.vuepress/configs/meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { fs } from '@vuepress/utils'
44
const require = createRequire(import.meta.url)
55

66
export const version = fs.readJsonSync(
7-
require.resolve('@vuepress/core/package.json')
7+
require.resolve('@vuepress/core/package.json'),
88
).version

docs/advanced/cookbook/usage-of-client-config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Inside the client config file, `@vuepress/client` package provides a helper func
1818
import { defineClientConfig } from '@vuepress/client'
1919

2020
export default defineClientConfig({
21-
enhance({ app, router, siteData }){},
22-
setup(){},
21+
enhance({ app, router, siteData }) {},
22+
setup() {},
2323
layouts: {},
2424
rootComponents: [],
2525
})

docs/guide/plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ But if you have too many things to do in your config file, you can consider to e
3737
```ts
3838
import myPlugin from './path/to/my-plugin.js'
3939

40-
export default {
40+
export default {
4141
plugins: [
4242
myPlugin(),
4343
],

docs/guide/theme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To configure the default theme, you need to import and use it in your config fil
1313
```ts
1414
import { defaultTheme } from 'vuepress'
1515

16-
export default {
16+
export default {
1717
theme: defaultTheme({
1818
// default theme config
1919
navbar: [

docs/zh/advanced/cookbook/usage-of-client-config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const pluginOrTheme = {
1818
import { defineClientConfig } from '@vuepress/client'
1919

2020
export default defineClientConfig({
21-
enhance({ app, router, siteData }){},
22-
setup(){},
21+
enhance({ app, router, siteData }) {},
22+
setup() {},
2323
layouts: {},
2424
rootComponents: [],
2525
})

ecosystem/plugin-active-header-links/src/client/composables/useActiveHeaderLinks.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const useActiveHeaderLinks = ({
2323
const scrollTop = Math.max(
2424
window.scrollY,
2525
document.documentElement.scrollTop,
26-
document.body.scrollTop
26+
document.body.scrollTop,
2727
)
2828
// check if we are at page top
2929
const isAtPageTop = Math.abs(scrollTop - 0) < offset
@@ -39,23 +39,23 @@ export const useActiveHeaderLinks = ({
3939
// get the total scroll length of current page
4040
const scrollHeight = Math.max(
4141
document.documentElement.scrollHeight,
42-
document.body.scrollHeight
42+
document.body.scrollHeight,
4343
)
4444
// check if we have reached page bottom
4545
// notice the `scrollBottom` might not be exactly equal to `scrollHeight`, so we add offset here
4646
const isAtPageBottom = Math.abs(scrollHeight - scrollBottom) < offset
4747

4848
// get all header links
4949
const headerLinks: HTMLAnchorElement[] = Array.from(
50-
document.querySelectorAll(headerLinkSelector)
50+
document.querySelectorAll(headerLinkSelector),
5151
)
5252
// get all header anchors
5353
const headerAnchors: HTMLAnchorElement[] = Array.from(
54-
document.querySelectorAll(headerAnchorSelector)
54+
document.querySelectorAll(headerAnchorSelector),
5555
)
5656
// filter anchors that do not have corresponding links
5757
const existedHeaderAnchors = headerAnchors.filter((anchor) =>
58-
headerLinks.some((link) => link.hash === anchor.hash)
58+
headerLinks.some((link) => link.hash === anchor.hash),
5959
)
6060

6161
for (let i = 0; i < existedHeaderAnchors.length; i++) {

ecosystem/plugin-back-to-top/src/client/components/BackToTop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const BackToTop = defineComponent({
2929
{
3030
name: 'back-to-top',
3131
},
32-
() => (show.value ? backToTopEl : null)
32+
() => (show.value ? backToTopEl : null),
3333
)
3434
},
3535
})

0 commit comments

Comments
 (0)