Skip to content

Commit 2202c47

Browse files
authored
Merge pull request #6 from VPKSoftOrg/debounceGridSizeCalculation
Debounce grid size calculation
2 parents 8e80f21 + fc9e7a0 commit 2202c47

File tree

10 files changed

+58
-62
lines changed

10 files changed

+58
-62
lines changed

biome.json

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
33
"vcs": {
44
"enabled": false,
55
"clientKind": "git",
66
"useIgnoreFile": false
77
},
88
"files": {
9-
"include": ["src/**/*.ts", "src/**/*.tsx"],
10-
"ignoreUnknown": false,
11-
"ignore": ["vite-env.d.ts", "PasswordKeeper-help"]
9+
"includes": ["src/**/*.ts", "src/**/*.tsx", "!src/**/*.d.ts"],
10+
"ignoreUnknown": false
1211
},
1312
"formatter": {
1413
"enabled": true,
@@ -17,23 +16,17 @@
1716
"indentWidth": 4,
1817
"lineEnding": "lf"
1918
},
20-
"organizeImports": {
21-
"enabled": true
22-
},
2319
"linter": {
2420
"enabled": true,
2521
"rules": {
2622
"nursery": {
27-
"useConsistentCurlyBraces": "error"
23+
"useConsistentCurlyBraces": "error",
24+
"useExportsLast": "error"
2825
},
2926
"recommended": false,
30-
"a11y": {
31-
"noBlankTarget": "error"
32-
},
3327
"complexity": {
3428
"noExtraBooleanCast": "error",
3529
"noForEach": "error",
36-
"noMultipleSpacesInRegularExpressionLiterals": "error",
3730
"noStaticOnlyClass": "error",
3831
"noUselessCatch": "error",
3932
"noUselessSwitchCase": "error",
@@ -136,8 +129,7 @@
136129
"useNumberToFixedDigitsArgument": "error",
137130
"useValidTypeof": "error"
138131
}
139-
},
140-
"ignore": ["**/.eslintrc.cjs", "src/localization/rust_i18n_transform", "**/vite.config.ts", "main.tsx"]
132+
}
141133
},
142134
"javascript": {
143135
"formatter": {

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
</head>
99
<body>
1010
<div id="root"></div>
11-
<script type="module" src="/src/main.tsx"></script>
11+
<script type="module" src="/src/Main.tsx"></script>
1212
</body>
1313
</html>

package-lock.json

Lines changed: 36 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "json-dictionary-browser",
33
"description": "JSON Dictionary Browser",
44
"private": true,
5-
"version": "0.0.3",
5+
"version": "0.0.4",
66
"type": "module",
77
"scripts": {
88
"dev": "vite",
@@ -27,7 +27,7 @@
2727
"styled-components": "^6.1.17"
2828
},
2929
"devDependencies": {
30-
"@biomejs/biome": "1.9.4",
30+
"@biomejs/biome": "^2.0.0-beta.2",
3131
"@types/node": "^22.15.3",
3232
"@types/react": "^19.1.2",
3333
"@types/react-dom": "^19.1.3",

src/App.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ let App = ({ className }: Props) => {
198198
setScrollHeight(totalHeight);
199199
}, []);
200200

201-
React.useEffect(() => {
202-
onResize();
203-
}, [onResize]);
204-
205201
React.useEffect(() => {
206202
globalThis.addEventListener("resize", onResize);
207203
return () => {
@@ -245,6 +241,13 @@ let App = ({ className }: Props) => {
245241
setAboutPopupVisible(true);
246242
}, []);
247243

244+
React.useEffect(() => {
245+
const timeout = globalThis.setTimeout(onResize, 1000);
246+
return () => {
247+
globalThis.clearTimeout(timeout);
248+
};
249+
}, [onResize]);
250+
248251
return (
249252
<div id="App" className={classNames(className, App.name)}>
250253
{contextHolder}

src/Components/DragDropOpenFileArea.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type DropButtonProps = ButtonProps & {
99
};
1010

1111
let StyledButton = (props: DropButtonProps) => {
12+
// biome-ignore lint/correctness/noUnusedVariables: the canDrop prop is not used by the Button component
1213
const { canDrop, ...restProps } = props;
1314
return <Button {...restProps} />;
1415
};

src/Hooks/Notify.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as React from "react";
44
/**
55
* Notification types for the {@link useNotify} hook.
66
*/
7-
export type NotificationType = "success" | "info" | "warning" | "error";
7+
type NotificationType = "success" | "info" | "warning" | "error";
88

99
/**
1010
* A custom hook for antd notifications.
@@ -30,3 +30,4 @@ const useNotify = (): [
3030
};
3131

3232
export { useNotify };
33+
export type { NotificationType };
File renamed without changes.

src/PwaBadge.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ const PwaBadge = () => {
5353
);
5454
};
5555

56-
export { PwaBadge };
57-
5856
/**
5957
* This function will register a periodic sync check every hour, you can modify the interval as needed.
6058
*/
@@ -81,3 +79,5 @@ const registerPeriodicSync = (period: number, swUrl: string, r: ServiceWorkerReg
8179
}
8280
}, period);
8381
};
82+
83+
export { PwaBadge };

src/Utilities/Images.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { default as LogoImage } from "../Images/LogoOnly.svg";
2+
export { default as NetlifyLogo } from "../Images/NetlifyLogo.svg";
23
export { default as GithubLogo } from "../Images/Octicons-mark-github.svg";
34
export { default as GithubLogoWhite } from "../Images/Octicons-mark-github-white.svg";
4-
export { default as NetlifyLogo } from "../Images/NetlifyLogo.svg";

0 commit comments

Comments
 (0)