Skip to content

Commit f5edcfc

Browse files
authored
chore: fix biome warning (#1353)
* chore: fix biome warning * chore: fix warning
1 parent 24a29bc commit f5edcfc

File tree

80 files changed

+228
-133
lines changed

Some content is hidden

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

80 files changed

+228
-133
lines changed

.dumi/components/ShowCase/CryptoInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const App: React.FC = () => {
5454
}}
5555
options={[ETH, USDT]}
5656
/>
57+
{/* biome-ignore lint/a11y/useKeyWithClickEvents: <explanation> */}
5758
<span
5859
style={{
5960
width: 30,

.dumi/components/Theme/components/Thumbnail.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const ThumbnailItem: React.FC<ThumbnailItemProps> = (item) => {
5858
curTheme.name === 'Dark' ? token.colorWhite : token.colorTextBase,
5959
} as React.CSSProperties;
6060
return (
61+
// biome-ignore lint/a11y/useKeyWithClickEvents: by design
6162
<div
6263
className={classNames(styles.thumbnailItem, {
6364
[styles.selected]: selected,
@@ -138,9 +139,9 @@ export type ThumbnailProps = {
138139
export const Thumbnail: React.FC<ThumbnailProps> = ({ selectedTheme, onSelect }) => {
139140
return (
140141
<div className={styles.thumbnail}>
141-
{themes.map((theme, index) => (
142+
{themes.map((theme) => (
142143
<ThumbnailItem
143-
key={index}
144+
key={theme.value}
144145
{...theme}
145146
selected={theme.name === selectedTheme.name}
146147
onSelect={onSelect}

.dumi/theme/builtins/IconSearch/IconSearch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const IconSearch: React.FC = () => {
9292
let iconList = categories[key as CategoriesKeys];
9393
if (searchKey) {
9494
const matchKey = searchKey
95-
.replace(new RegExp(`^<([a-zA-Z]*)\\s/>$`, 'gi'), (_, name) => name)
95+
.replace(/^<([a-zA-Z]*)\s\/>$/gi, (_, name) => name)
9696
.replace(/(Colorful|Filled|CircleFilled|CircleColorful)$/gi, '')
9797
.toLowerCase();
9898
iconList = iconList.filter((iconName) => iconName.toLowerCase().includes(matchKey));

.dumi/theme/builtins/IconSearch/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const IconSearchFallback = () => {
4343
{Array(24)
4444
.fill(1)
4545
.map((_, index) => (
46+
// biome-ignore lint/suspicious/noArrayIndexKey:
4647
<div key={index} className={styles.skeletonWrapper}>
4748
<Skeleton.Node active style={{ height: 110, width: '100%' }}>
4849
{' '}

.dumi/theme/builtins/IconSearch/themeIcons.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const FilledIcon: CustomIconComponent = (props) => {
2323
' 12 12v680c0 6.6-5.4 12-12 12z';
2424
return (
2525
<svg {...props} viewBox="0 0 1024 1024">
26+
<title>Filled icons</title>
2627
<path d={path} />
2728
</svg>
2829
);
@@ -36,6 +37,7 @@ export const CircleFilledIcon: CustomIconComponent = (props) => {
3637
'68 368 0 203.41-164.622 368-368 368z';
3738
return (
3839
<svg {...props} viewBox="0 0 1024 1024">
40+
<title>CircleFilled icons</title>
3941
<path d={path} />
4042
</svg>
4143
);

.dumi/theme/builtins/InstallDependencies/npm.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const NpmIcon: React.FC<IconProps> = (props) => {
1919
viewBox="0 0 16 16"
2020
width="1em"
2121
>
22+
<title>NPM</title>
2223
<path d="M0 0v16h16v-16h-16zM13 13h-2v-8h-3v8h-5v-10h10v10z" />
2324
</svg>
2425
);

.dumi/theme/builtins/NormalInstallDependencies/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface NormalInstallProps {
77

88
const NormalInstallDependencies: React.FC<NormalInstallProps> = (props) => {
99
const { packageNames, save } = props;
10-
let realSave: boolean = false;
10+
let realSave = false;
1111
if (save === 'true') {
1212
realSave = true;
1313
} else if (save !== 'false') {

.dumi/theme/builtins/Overview/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ const useStyle = createStyles(({ token, css }, { dark }: { dark: boolean }) => (
4343
border-radius: 36px;
4444
font-size: 44px;
4545
background-image: ${dark
46-
? `linear-gradient(175deg, #262525 -8%, #363535 32%)`
47-
: `linear-gradient(175deg, #f5f8fc -8%, #ffffff 32%)`};
46+
? 'linear-gradient(175deg, #262525 -8%, #363535 32%)'
47+
: 'linear-gradient(175deg, #f5f8fc -8%, #ffffff 32%)'};
4848
border-image-slice: 1;
4949
box-shadow: ${dark
50-
? `0px 0 14px 2px rgba(210, 198, 255, 0.25), inset 0px -2px 0 0 #525355`
51-
: `0px 25px 14px 2px rgba(210, 198, 255, 0.25), inset 0px -4px 0 0 #e6ebf3`};
50+
? '0px 0 14px 2px rgba(210, 198, 255, 0.25), inset 0px -2px 0 0 #525355'
51+
: '0px 25px 14px 2px rgba(210, 198, 255, 0.25), inset 0px -4px 0 0 #e6ebf3'};
5252
`,
5353
componentsOverviewCard: css`
5454
cursor: pointer;

.dumi/theme/layouts/GlobalLayout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const GlobalLayout: React.FC = () => {
1818

1919
useServerInsertedHTML(() => {
2020
const styleText = extractStyle(cssCache, { plain: true });
21-
return <style id="antd-cssinjs" dangerouslySetInnerHTML={{ __html: styleText }}></style>;
21+
// biome-ignore lint/security/noDangerouslySetInnerHtml: by design
22+
return <style id="antd-cssinjs" dangerouslySetInnerHTML={{ __html: styleText }} />;
2223
});
2324

2425
return (

.dumirc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { existsSync, readdirSync } from 'fs';
2-
import { join, resolve } from 'path';
1+
import { existsSync, readdirSync } from 'node:fs';
2+
import { join, resolve } from 'node:path';
33
import { defineConfig } from 'dumi';
44

55
const openSSR = process.env.SSR || process.env.NODE_ENV === 'production';

0 commit comments

Comments
 (0)