From 864601a0daa0d4c3d9bd70d6cce5ef19e40ac03a Mon Sep 17 00:00:00 2001 From: Kirk Lin Date: Wed, 11 Sep 2024 18:51:21 +0800 Subject: [PATCH] style: update code style --- README.en.md | 2 +- README.md | 2 +- examples/package.json | 2 +- examples/src/utils/typeChecks.ts | 2 +- src/typography/css/annotation.ts | 2 +- src/typography/css/base.ts | 4 ++-- src/typography/css/heading.ts | 4 ++-- src/typography/css/other.ts | 2 +- src/typography/preflights/index.ts | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.en.md b/README.en.md index b7e241c..1eb6570 100644 --- a/README.en.md +++ b/README.en.md @@ -77,7 +77,7 @@ export default defineConfig({ presetUno(), presetChinese({ extendTheme: false, // Do not extend the theme object - themeKey: 'customFontFamily', // Use a custom theme key + themeKey: "customFontFamily", // Use a custom theme key chineseType: "traditional", // Specify the text as Traditional Chinese }), // ...custom presets diff --git a/README.md b/README.md index 2af620e..2c7044d 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ export default defineConfig({ presetUno(), presetChinese({ extendTheme: false, // 不扩展主题对象 - themeKey: 'customFontFamily', // 使用自定义的主题键 + themeKey: "customFontFamily", // 使用自定义的主题键 chineseType: "traditional", // 指定文本为繁体中文 }), // ...custom presets diff --git a/examples/package.json b/examples/package.json index db4a8cf..694ced7 100644 --- a/examples/package.json +++ b/examples/package.json @@ -1,7 +1,7 @@ { "name": "examples", - "version": "0.0.1", "type": "module", + "version": "0.0.1", "private": true, "packageManager": "pnpm@9.10.0", "description": "unocss-preset-chinese-examples", diff --git a/examples/src/utils/typeChecks.ts b/examples/src/utils/typeChecks.ts index 800cce2..e24b7b3 100644 --- a/examples/src/utils/typeChecks.ts +++ b/examples/src/utils/typeChecks.ts @@ -47,7 +47,7 @@ export { export const isServerRendering = (() => { try { return !(typeof window !== "undefined" && document !== undefined); - } catch (e) { + } catch () { return true; } })(); diff --git a/src/typography/css/annotation.ts b/src/typography/css/annotation.ts index 4e1cc5c..1dc6b5b 100644 --- a/src/typography/css/annotation.ts +++ b/src/typography/css/annotation.ts @@ -19,7 +19,7 @@ export function generateAnnotationCss(selectorName: string) { ${getNonCjkBlockCss(`${selectorName}--annotation em`, { "-webkit-text-emphasis": "none", "text-emphasis": "none", - })} + })} .${selectorName}--annotation .${selectorName}-meta { margin-block-start: calc(${getVariables.stdBlockUnit} * 0.5); margin-block-end: ${getVariables.stdBlockUnit}; diff --git a/src/typography/css/base.ts b/src/typography/css/base.ts index e1a20d7..2244821 100644 --- a/src/typography/css/base.ts +++ b/src/typography/css/base.ts @@ -6,9 +6,9 @@ export function generateBaseCss(selectorName: string) { ${getNonCjkBlockCss(`${selectorName} p`, { "text-align": "start", - })} + })} ${getNonCjkBlockCss(selectorName, { "letter-spacing": getVariables.letterSpacingNormal, - })} + })} `; } diff --git a/src/typography/css/heading.ts b/src/typography/css/heading.ts index b572b39..e44f2dc 100644 --- a/src/typography/css/heading.ts +++ b/src/typography/css/heading.ts @@ -6,9 +6,9 @@ export function generateHeadingCss(selectorName: string) { ${getNonCjkBlockCss(`${selectorName} h1, h2, h3`, { "letter-spacing": "0", - })} + })} ${getNonCjkBlockCss(selectorName, { "letter-spacing": getVariables.letterSpacingNormal, - })} + })} `; } diff --git a/src/typography/css/other.ts b/src/typography/css/other.ts index 4620c5a..96af1ef 100644 --- a/src/typography/css/other.ts +++ b/src/typography/css/other.ts @@ -83,7 +83,7 @@ export function generateOtherCss(selectorName: string) { ${getNonCjkBlockCss(`${selectorName}-em`, { "-webkit-text-emphasis": "start", "text-emphasis": "none", -})} + })} .${selectorName} .${selectorName}-ruby--inline { display: inline-flex; flex-direction: column-reverse; diff --git a/src/typography/preflights/index.ts b/src/typography/preflights/index.ts index 5849d41..5c0aba2 100644 --- a/src/typography/preflights/index.ts +++ b/src/typography/preflights/index.ts @@ -27,7 +27,7 @@ function getCSS( .map((s) => { // pseudo class & pseudo elements matcher // matches :, ::, -, (), numbers and words - const match = s.match(/::?(?:[():\-\d\w]+)$/g); + const match = s.match(/:[():\-\w]+$/g); if (match) { const matchStr = match[0];