Skip to content

Commit 0a4d495

Browse files
committed
refactor: apply Biome suggestions
1 parent d553d16 commit 0a4d495

File tree

9 files changed

+149
-127
lines changed

9 files changed

+149
-127
lines changed

website/src/components/templates/FuncTemplate.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,14 @@ function ScopedDefinitions({
102102
{parent ? (
103103
// Currently, the scope has at most two levels.
104104
// Therefore, it is sufficient to only annotate the direct `parent`.
105-
<>
106-
<Translation translationKey="definitionOf" name={parent.name} />
107-
</>
105+
<Translation translationKey="definitionOf" name={parent.name} />
108106
) : (
109107
<Translation translationKey="definition" />
110108
)}
111109
<Tooltip kind="definitions" />
112110
</h2>
113111

114-
{scope.map((method, index) => {
112+
{scope.map((method, _index) => {
115113
const methodId = `${parentId}definitions-${method.name}`;
116114

117115
return (

website/src/components/templates/GroupTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const GroupTemplate: FC<GroupTemplateProps> = ({
3434
<>
3535
<h2 id="functions">Function</h2>
3636

37-
{content.functions.map((method, index) => (
37+
{content.functions.map((method, _index) => (
3838
<div key={method.name}>
3939
<h3 id={`functions-${method.name}`} class="method-head">
4040
<code class="text-base font-medium">{method.name}</code>

website/src/components/templates/TypeTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const TypeTemplate: FC<TypeTemplateProps> = ({
5757
<Tooltip kind="definitions" />
5858
</h2>
5959

60-
{content.scope.map((method, index) => (
60+
{content.scope.map((method, _index) => (
6161
<div key={method.name}>
6262
<h3
6363
id={`definitions-${method.name}`}

website/src/components/ui/FunctionParameters.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const FunctionParameters: FC<FunctionParametersProps> = ({
2525
}) => {
2626
return (
2727
<div class="space-y-6">
28-
{func.params.map((param, index) => (
28+
{func.params.map((param, _index) => (
2929
<div
3030
key={param.name}
3131
class="bg-gray-50 rounded-md p-4 border border-gray-100"

website/src/components/ui/common/SideNavigation.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const SideNavigation = ({
1515
return (
1616
<nav class="folding flex-none w-full bg-white border border-neutral-200/60 rounded-md sticky top-[80px] mt-4 mb-8 h-[calc(100vh-80px-1rem)] overflow-auto px-3.5 py-3">
1717
<ul class="space-y-1 text-sm text-neutral-700">
18-
{docs?.map((firstLevel, idx) => (
18+
{docs?.map((firstLevel, _idx) => (
1919
<>
2020
{firstLevel.part && (
2121
<li
@@ -63,7 +63,7 @@ export const SideNavigation = ({
6363
x-transition:enter-start="opacity-0 transform -translate-y-2"
6464
x-transition:enter-end="opacity-100 transform translate-y-0"
6565
>
66-
{firstLevel.children.map((secondLevel, idx2) => (
66+
{firstLevel.children.map((secondLevel, _idx2) => (
6767
<div key={secondLevel.route}>
6868
{secondLevel.part && (
6969
<li class="category py-1 text-sm font-semibold text-gray-500 tracking-wide">
@@ -112,7 +112,7 @@ export const SideNavigation = ({
112112
x-transition:enter-end="opacity-100 transform translate-y-0"
113113
>
114114
{secondLevel.children.map(
115-
(thirdLevel, idx3) => (
115+
(thirdLevel, _idx3) => (
116116
<div key={thirdLevel.route}>
117117
{thirdLevel.part && (
118118
<li class="category">

website/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if (import.meta.env.DEV) {
8989
rewriteRequestPath: (path) => {
9090
return path.slice(basePath.length);
9191
},
92-
onNotFound: (path, c) => {
92+
onNotFound: (path, _c) => {
9393
console.log(
9494
`${path} is not found while trying to serve a static asset`,
9595
);

website/src/translation/en-US.tsx

Lines changed: 70 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Fragment } from "hono/jsx/jsx-runtime";
12
import type { TooltipProps } from "../components/ui/Tooltip";
23
import { githubOrganizationUrl } from "../metadata";
34
import type { TranslationComponent, TranslationObject } from "./";
@@ -39,148 +40,158 @@ export const translation: TranslationObject = {
3940
export const Translation: TranslationComponent = (props) => {
4041
switch (props.translationKey) {
4142
case "definition":
42-
return <>Definition</>;
43+
return <Fragment>Definition</Fragment>;
4344
case "constructor":
44-
return <>Constructor</>;
45+
return <Fragment>Constructor</Fragment>;
4546
case "definitionOf":
4647
return (
47-
<>
48+
<Fragment>
4849
<code>{props.name}</code> Definition
49-
</>
50+
</Fragment>
5051
);
5152
case "search":
52-
return <>Search</>;
53+
return <Fragment>Search</Fragment>;
5354
case "defaultValue":
54-
return <>Default value:</>;
55+
return <Fragment>Default value:</Fragment>;
5556
case "stringValues":
56-
return <>Available string values:</>;
57+
return <Fragment>Available string values:</Fragment>;
5758
case "showExample":
58-
return <>Show example</>;
59+
return <Fragment>Show example</Fragment>;
5960
case "tableOfContents":
60-
return <>On this page</>;
61+
return <Fragment>On this page</Fragment>;
6162
case "nextPage":
62-
return <>Next page</>;
63+
return <Fragment>Next page</Fragment>;
6364
case "previousPage":
64-
return <>Previous page</>;
65+
return <Fragment>Previous page</Fragment>;
6566
case "referenceDescription":
6667
return (
67-
<>
68+
<Fragment>
6869
Detailed reference for all Typst syntax, concepts, types, and
6970
functions.
70-
</>
71+
</Fragment>
7172
);
7273
case "tutorialDescription":
73-
return <>Learn how to use Typst step by step.</>;
74+
return <Fragment>Learn how to use Typst step by step.</Fragment>;
7475
case "tutorial":
75-
return <>Tutorial</>;
76+
return <Fragment>Tutorial</Fragment>;
7677
case "openOfficialDocs":
77-
return <>Open official docs</>;
78+
return <Fragment>Open official docs</Fragment>;
7879
case "reference":
79-
return <>Reference</>;
80+
return <Fragment>Reference</Fragment>;
8081
case "typstOfficialDocs":
81-
return <>Typst official docs</>;
82+
return <Fragment>Typst official docs</Fragment>;
8283
case "typstOfficialWebsite":
83-
return <>Typst official website</>;
84+
return <Fragment>Typst official website</Fragment>;
8485
case "untranslated":
85-
return <>Untranslated</>;
86+
return <Fragment>Untranslated</Fragment>;
8687
case "untranslatedMessage":
8788
return (
88-
<>
89+
<Fragment>
8990
This page has not been translated yet. The original content is shown.
90-
</>
91+
</Fragment>
9192
);
9293
case "communityContent":
93-
return <>Community original content</>;
94+
return <Fragment>Community original content</Fragment>;
9495
case "contentAddedByCommunity":
9596
return (
96-
<>
97+
<Fragment>
9798
This page contains content that is not part of the official
9899
documentation, added independently by the community.
99-
</>
100+
</Fragment>
100101
);
101102
case "partiallyTranslated":
102-
return <>Partially translated</>;
103+
return <Fragment>Partially translated</Fragment>;
103104
case "partiallyTranslatedMessage":
104105
return (
105-
<>
106+
<Fragment>
106107
This page is partially translated. Some original content is included.
107-
</>
108+
</Fragment>
108109
);
109110
case "translated":
110-
return <>Translated</>;
111+
return <Fragment>Translated</Fragment>;
111112
case "translatedMessage":
112-
return <>This page has been translated into English.</>;
113+
return <Fragment>This page has been translated into English.</Fragment>;
113114
case "elementFunction":
114-
return <>Element</>;
115+
return <Fragment>Element</Fragment>;
115116
case "elementFunctionDescription":
116117
return (
117-
<>
118+
<Fragment>
118119
Element functions can be customized with <code>set</code> and{" "}
119120
<code>show</code> rules.
120-
</>
121+
</Fragment>
121122
);
122123
case "contextFunction":
123-
return <>Context</>;
124+
return <Fragment>Context</Fragment>;
124125
case "contextFunctionDescription":
125-
return <>Context functions can only be used when the context is known.</>;
126+
return (
127+
<Fragment>
128+
Context functions can only be used when the context is known.
129+
</Fragment>
130+
);
126131
case "definitionTooltip":
127-
return <>Definition</>;
132+
return <Fragment>Definition</Fragment>;
128133
case "definitionTooltipDescription":
129134
return (
130-
<>
135+
<Fragment>
131136
These functions and types can have related definitions. To access a
132137
definition, specify the name of the function or type, followed by the
133138
definition name separated by a period.
134-
</>
139+
</Fragment>
135140
);
136141
case "argument":
137-
return <>Parameter</>;
142+
return <Fragment>Parameter</Fragment>;
138143
case "argumentDescription":
139144
return (
140-
<>
145+
<Fragment>
141146
Parameters are input values for functions. Specify them in parentheses
142147
after the function name.
143-
</>
148+
</Fragment>
144149
);
145150
case "variadic":
146-
return <>Variadic</>;
151+
return <Fragment>Variadic</Fragment>;
147152
case "variadicDescription":
148-
return <>Variadic parameters can be specified multiple times.</>;
153+
return (
154+
<Fragment>
155+
Variadic parameters can be specified multiple times.
156+
</Fragment>
157+
);
149158
case "positional":
150-
return <>Positional</>;
159+
return <Fragment>Positional</Fragment>;
151160
case "positionalDescription":
152161
return (
153-
<>
162+
<Fragment>
154163
Positional parameters can be set by specifying them in order, omitting
155164
the parameter name.
156-
</>
165+
</Fragment>
157166
);
158167
case "required":
159-
return <>Required</>;
168+
return <Fragment>Required</Fragment>;
160169
case "requiredDescription":
161170
return (
162-
<>Required parameters must be specified when calling the function.</>
171+
<Fragment>
172+
Required parameters must be specified when calling the function.
173+
</Fragment>
163174
);
164175
case "document":
165-
return <>Document</>;
176+
return <Fragment>Document</Fragment>;
166177
case "langVersion":
167-
return <>English</>;
178+
return <Fragment>English</Fragment>;
168179
case "translationRate":
169-
return <>Translated</>;
180+
return <Fragment>Translated</Fragment>;
170181
case "settable":
171-
return <>Settable</>;
182+
return <Fragment>Settable</Fragment>;
172183
case "settableDescription":
173184
return (
174-
<>
185+
<Fragment>
175186
Settable parameters can be set using the <code>set</code> rule,
176187
changing the default value used thereafter.
177-
</>
188+
</Fragment>
178189
);
179190
case "siteNoticeBannerTitle":
180-
return <>Info</>;
191+
return <Fragment>Info</Fragment>;
181192
case "siteNoticeBannerDescription":
182193
return (
183-
<>
194+
<Fragment>
184195
This site is generated using the static site generator developed by
185196
the <a href="https://github.com/typst-community">Typst Community</a>.
186197
Please adjust the text content of this banner according to your usage
@@ -191,13 +202,13 @@ export const Translation: TranslationComponent = (props) => {
191202
Issue #874 on typst/typst
192203
</a>
193204
.
194-
</>
205+
</Fragment>
195206
);
196207
case "footer":
197208
return (
198-
<>
209+
<Fragment>
199210
Translated by <a href={githubOrganizationUrl}>Typst Community</a>
200-
</>
211+
</Fragment>
201212
);
202213
default:
203214
return null;

0 commit comments

Comments
 (0)