mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-19 07:48:37 +02:00
CODEBASE: Fix lint errors 2 (#1756)
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ export const A = (props: React.PropsWithChildren<{ href?: string }>): React.Reac
|
||||
cursor: "pointer",
|
||||
}}
|
||||
>
|
||||
<CorruptableText content={props.children + ""} spoiler={true} />
|
||||
<CorruptableText content={String(props.children)} spoiler={true} />
|
||||
</span>
|
||||
);
|
||||
return (
|
||||
|
||||
@@ -38,7 +38,7 @@ type RowName = SkillRowName | "HP" | "Money";
|
||||
const OverviewEventEmitter = new EventEmitter();
|
||||
|
||||
// These values aren't displayed, they're just used for comparison to check if state has changed
|
||||
const valUpdaters: Record<RowName, () => any> = {
|
||||
const valUpdaters: Record<RowName, () => unknown> = {
|
||||
HP: () => Player.hp.current + "|" + Player.hp.max, // This isn't displayed, it's just compared for updates.
|
||||
Money: () => Player.money,
|
||||
Hack: () => Player.skills.hacking,
|
||||
|
||||
@@ -26,9 +26,11 @@ export function CinematicLine(props: IProps): React.ReactElement {
|
||||
return;
|
||||
}
|
||||
let cancel = false;
|
||||
(async () => {
|
||||
await sleep(10).then(() => !cancel && advance());
|
||||
})();
|
||||
sleep(10)
|
||||
.then(() => !cancel && advance())
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
return () => {
|
||||
cancel = true;
|
||||
};
|
||||
|
||||
@@ -399,7 +399,11 @@ export const ImportSave = (props: { saveData: SaveData; automatic: boolean }): J
|
||||
<ConfirmationModal
|
||||
open={isImportModalOpen}
|
||||
onClose={closeImportModal}
|
||||
onConfirm={handleImport}
|
||||
onConfirm={() => {
|
||||
handleImport().catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
}}
|
||||
confirmationText={
|
||||
<>
|
||||
Importing new save game data will <strong>completely wipe</strong> the current game data!
|
||||
|
||||
@@ -298,7 +298,16 @@ function LogWindow({ hidden, script, onClose }: LogWindowProps): React.ReactElem
|
||||
return !(bounds.right < 0 || bounds.bottom < 0 || bounds.left > innerWidth || bounds.top > outerWidth);
|
||||
};
|
||||
|
||||
const onDrag = (e: DraggableEvent): void | false => {
|
||||
/**
|
||||
* The returned type of onDrag is a bit weird here. The Draggable component expects an onDrag that returns "void | false".
|
||||
* In that component's internal code, it checks for the explicit "false" value. If onDrag returns false, the component
|
||||
* cancels the dragging.
|
||||
*
|
||||
* That's why they use "void | false" as the returned type. However, in TypeScript, "void" is not supposed to be used
|
||||
* like that. ESLint will complain "void is not valid as a constituent in a union type". Please check its documentation
|
||||
* for the reason. In order to solve this problem, I changed the returned type to "undefined | false".
|
||||
*/
|
||||
const onDrag = (e: DraggableEvent): undefined | false => {
|
||||
e.preventDefault();
|
||||
// bound to body
|
||||
if (
|
||||
|
||||
@@ -98,7 +98,7 @@ export function RecoveryRoot({ softReset, errorData, resetError }: IProps): Reac
|
||||
{sourceError && (
|
||||
<Box>
|
||||
<Typography variant="h6" color={Settings.theme.error}>
|
||||
Error: {sourceError.toString()}
|
||||
Error: {String(sourceError)}
|
||||
</Typography>
|
||||
<br />
|
||||
</Box>
|
||||
|
||||
@@ -14,7 +14,7 @@ interface IProps {
|
||||
const useStyles = makeStyles()({
|
||||
snackbar: {
|
||||
// Log popup z-index increments, so let's add a padding to be well above them.
|
||||
zIndex: `${logBoxBaseZIndex + 1000} !important` as any,
|
||||
zIndex: `${logBoxBaseZIndex + 1000} !important`,
|
||||
|
||||
"& .MuiAlert-icon": {
|
||||
alignSelf: "center",
|
||||
|
||||
Reference in New Issue
Block a user