Skip to content

Commit

Permalink
fix: clean up ignored exhaustive deps rules, fix setup flow
Browse files Browse the repository at this point in the history
  • Loading branch information
klausborges committed Dec 17, 2024
1 parent 54fa661 commit 514fc5a
Show file tree
Hide file tree
Showing 41 changed files with 528 additions and 670 deletions.
10 changes: 7 additions & 3 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
},
"files": {
"ignoreUnknown": false,
"ignore": ["build", "build-tsc", "standalone-plugins", "standalone"]
"ignore": [
"build",
"build-tsc",
"standalone-plugins",
"standalone"
]
},
"formatter": {
"enabled": true,
Expand All @@ -29,8 +34,7 @@
"noCommonJs": "error"
},
"correctness": {
"useImportExtensions": "error",
"useExhaustiveDependencies": "off"
"useImportExtensions": "error"
},
"suspicious": {
"noExplicitAny": "off",
Expand Down
72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@
"node": ">=20.0.0"
},
"type": "module",
"workspaces": ["packages/*", "plugins/*"],
"keywords": ["platform", "iot", "tagoio", "tcore"],
"workspaces": [
"packages/*",
"plugins/*"
],
"keywords": [
"platform",
"iot",
"tagoio",
"tcore"
],
"bugs": {
"url": "https://github.com/tago-io/tcore/issues"
},
Expand Down Expand Up @@ -44,7 +52,7 @@
"zod": "3.23.8"
},
"devDependencies": {
"@biomejs/biome": "1.9.3",
"@biomejs/biome": "1.9.4",
"@swc-node/register": "1.10.9",
"@tago-io/tcore-sdk": "0.7.2",
"@testing-library/dom": "10.4.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"watch": "vite",
"build": "vite build",
"build-watch": "vite build --watch",
"test": "vitest"
"test": "vitest",
"lint": "biome check .",
"format": "biome format . --write",
"lint-fix": "biome check . --write"
},
"dependencies": {
"@antv/g2": "4.1.23",
Expand Down
6 changes: 3 additions & 3 deletions packages/console/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const WrappedStoreRoutes = observer(() => {
}
}, [plugins]);

// biome-ignore lint/correctness/useExhaustiveDependencies: useEffect state machine
useEffect(() => {
if (status) {
if (status.database?.error) {
Expand Down Expand Up @@ -131,17 +132,16 @@ const WrappedStoreRoutes = observer(() => {
store.accountConfigured = status.account;
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [status]);
}, [status, navigate]);

/**
* Starts the socket connection.
*/
// biome-ignore lint/correctness/useExhaustiveDependencies: mobx observers
useEffect(() => {
if (store.masterPassword || store.token) {
startSocket();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [store.masterPassword, store.token]);

if (!readyToRender) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import ActionTypePicker from "../ActionTypePicker/ActionTypePicker.tsx";
import HttpHeaders from "../HttpHeaders/HttpHeaders.tsx";
import MultipleAnalysis from "../MultipleAnalysis/MultipleAnalysis.tsx";

/**
* Props.
*/
interface IActionFields {
/**
* Error of the fields.
Expand Down Expand Up @@ -178,10 +175,10 @@ function ActionFields(props: IActionFields) {
/**
* Sets the type into the action.
*/
// biome-ignore lint/correctness/useExhaustiveDependencies(action): useEffect state machine
useEffect(() => {
onChangeAction({ ...action, type: actionType?.id || actionType });
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [actionType]);
}, [actionType, onChangeAction]);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ const defaultOptions: IOption[] = [
},
];

/**
* Props.
*/
interface IActionTypePicker {
/**
* Option object.
Expand Down Expand Up @@ -166,8 +163,7 @@ function ActionTypePicker(props: IActionTypePicker) {
if (isSchedule && props.value?.id === "tagoio") {
props.onChange(null as any);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.value, isSchedule]);
}, [props.value, isSchedule, props.onChange]);

return (
<OptionsPicker<IOption>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function ScheduleTrigger(props: IScheduleTrigger) {
useEffect(() => {
const explanation = getCronExplanation(scheduleData.cron || "");
setCronExplanation(explanation);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [scheduleData.cron]);

const showExplanation =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import type {
import MinimumScheduleMessage from "./MinimumScheduleMessage.tsx";
import * as Style from "./TypeScheduleOptions.style";

/**
* Props.
*/
interface ITypeScheduleOptions {
/**
* Error of the fields.
Expand All @@ -34,11 +31,11 @@ function TypeScheduleOptions(props: ITypeScheduleOptions) {
const inputRef = useRef<HTMLInputElement>(null);
const { errors, scheduleData, onChangeScheduleData } = props;

// biome-ignore lint/correctness/useExhaustiveDependencies: useEffect auto-trigger
useEffect(() => {
if (inputRef.current && !scheduleData.interval) {
inputRef.current.focus();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [scheduleData.type]);

return (
Expand Down
Loading

0 comments on commit 514fc5a

Please sign in to comment.