Skip to content

Commit a73895c

Browse files
committed
fix: fixed eslint errors
1 parent 8bc315c commit a73895c

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

examples/vitepress/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vitepress",
3-
"private": true,
43
"type": "module",
4+
"private": true,
55
"scripts": {
66
"dev": "vitepress dev",
77
"start": "vitepress dev",

src/index.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { createUnplugin } from 'unplugin'
55
import { getHeadLinkTags } from './loaders'
66
import { customVirtualModule } from './loaders/custom'
77
import { fontsourceImports, fontsourceVirtualModule } from './loaders/fontsource'
8-
import { HtmlTagDescriptor } from 'vite'
98

109
const virtualStylesId = 'unfonts.css'
1110
const resolvedVirtualStylesId = `\0${virtualStylesId}`
@@ -91,10 +90,11 @@ export default createUnplugin<Options | undefined>((userOptions) => {
9190
const { prefetch: wantPrefetch, preload: wantPreload } = options?.custom || {}
9291
for (const file of files) {
9392
if (!(
94-
wantPrefetch === true || wantPreload === true ||
95-
(wantPrefetch === undefined && wantPreload === undefined)
96-
))
93+
wantPrefetch === true || wantPreload === true
94+
|| (wantPrefetch === undefined && wantPreload === undefined)
95+
)) {
9796
continue
97+
}
9898
const ext = extname(file)
9999
tags.push({
100100
tag: 'link',
@@ -113,7 +113,8 @@ export default createUnplugin<Options | undefined>((userOptions) => {
113113
const newTags = options?.custom?.linkFilter(tags)
114114
if (Array.isArray(newTags)) {
115115
tagsReturned = newTags
116-
} else {
116+
}
117+
else {
117118
tagsReturned = newTags ? tags : []
118119
}
119120
}
@@ -140,10 +141,11 @@ function generateVitepressBundle(
140141
const { prefetch: wantPrefetch, preload: wantPreload } = options?.custom || {}
141142
for (const file of files) {
142143
if (!(
143-
wantPrefetch === true || wantPreload === true ||
144-
(wantPrefetch === undefined && wantPreload === undefined)
145-
))
144+
wantPrefetch === true || wantPreload === true
145+
|| (wantPrefetch === undefined && wantPreload === undefined)
146+
)) {
146147
continue
148+
}
147149

148150
const ext = extname(file)
149151
tags.push({
@@ -164,7 +166,8 @@ function generateVitepressBundle(
164166
const newTags = options?.custom?.linkFilter(tags)
165167
if (Array.isArray(newTags)) {
166168
tagsReturned = newTags
167-
} else {
169+
}
170+
else {
168171
tagsReturned = newTags ? tags : []
169172
}
170173
}

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HtmlTagDescriptor } from "vite"
1+
import type { HtmlTagDescriptor } from 'vite'
22

33
export interface Options {
44
custom?: CustomFonts

0 commit comments

Comments
 (0)