FIX: Update biome and apply automatic fixes

This commit is contained in:
Nicolás Hatcher
2025-11-13 18:57:46 +01:00
committed by Nicolás Hatcher Andrés
parent e0339f641b
commit 4e9d7611a8
21 changed files with 636 additions and 666 deletions

View File

@@ -1,5 +1,4 @@
{ {
"organizeImports": { "enabled": true },
"linter": { "linter": {
"enabled": true, "enabled": true,
"rules": { "rules": {

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@ironcalc/workbook", "name": "@ironcalc/workbook",
"version": "0.3.2", "version": "0.6.0",
"type": "module", "type": "module",
"main": "./dist/ironcalc.js", "main": "./dist/ironcalc.js",
"module": "./dist/ironcalc.js", "module": "./dist/ironcalc.js",
@@ -26,7 +26,7 @@
"react-i18next": "^15.5.2" "react-i18next": "^15.5.2"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "1.9.4", "@biomejs/biome": "2.3.5",
"@storybook/react": "^9.0.5", "@storybook/react": "^9.0.5",
"@storybook/react-vite": "^9.0.5", "@storybook/react-vite": "^9.0.5",
"@vitejs/plugin-react": "^4.2.1", "@vitejs/plugin-react": "^4.2.1",

View File

@@ -1,9 +1,9 @@
import { import {
getTokens,
type Model, type Model,
type Range, type Range,
type Reference, type Reference,
type TokenType, type TokenType,
getTokens,
} from "@ironcalc/wasm"; } from "@ironcalc/wasm";
import type { JSX } from "react"; import type { JSX } from "react";
import type { ActiveRange } from "../workbookState"; import type { ActiveRange } from "../workbookState";

View File

@@ -2,12 +2,12 @@ import type { Model } from "@ironcalc/wasm";
import { styled } from "@mui/material"; import { styled } from "@mui/material";
import { Fx } from "../../icons"; import { Fx } from "../../icons";
import { theme } from "../../theme"; import { theme } from "../../theme";
import { FORMULA_BAR_HEIGHT } from "../constants";
import Editor from "../Editor/Editor"; import Editor from "../Editor/Editor";
import { import {
COLUMN_WIDTH_SCALE, COLUMN_WIDTH_SCALE,
ROW_HEIGH_SCALE, ROW_HEIGH_SCALE,
} from "../WorksheetCanvas/constants"; } from "../WorksheetCanvas/constants";
import { FORMULA_BAR_HEIGHT } from "../constants";
import type { WorkbookState } from "../workbookState"; import type { WorkbookState } from "../workbookState";
type FormulaBarProps = { type FormulaBarProps = {

View File

@@ -6,8 +6,8 @@ import {
MenuItem, MenuItem,
Paper, Paper,
Select, Select,
TextField,
styled, styled,
TextField,
} from "@mui/material"; } from "@mui/material";
import { t } from "i18next"; import { t } from "i18next";
import { Check, Tag } from "lucide-react"; import { Check, Tag } from "lucide-react";

View File

@@ -1,5 +1,5 @@
import type { DefinedName, WorksheetProperties } from "@ironcalc/wasm"; import type { DefinedName, WorksheetProperties } from "@ironcalc/wasm";
import { Button, Tooltip, styled } from "@mui/material"; import { Button, styled, Tooltip } from "@mui/material";
import { t } from "i18next"; import { t } from "i18next";
import { import {
ArrowLeft, ArrowLeft,

View File

@@ -1,4 +1,4 @@
import { Dialog, TextField, styled } from "@mui/material"; import { Dialog, styled, TextField } from "@mui/material";
import { Check, X } from "lucide-react"; import { Check, X } from "lucide-react";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";

View File

@@ -1,5 +1,5 @@
import { Button, Menu, MenuItem, styled } from "@mui/material";
import type { MenuItemProps } from "@mui/material"; import type { MenuItemProps } from "@mui/material";
import { Button, Menu, MenuItem, styled } from "@mui/material";
import { import {
ChevronDown, ChevronDown,
EyeOff, EyeOff,

View File

@@ -1,12 +1,11 @@
import { styled } from "@mui/material"; import { styled, Tooltip } from "@mui/material";
import { Tooltip } from "@mui/material";
import { Menu, Plus } from "lucide-react"; import { Menu, Plus } from "lucide-react";
import { useState } from "react"; import { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { IronCalcLogo } from "../../icons"; import { IronCalcLogo } from "../../icons";
import { theme } from "../../theme"; import { theme } from "../../theme";
import { StyledButton } from "../Toolbar/Toolbar";
import { NAVIGATION_HEIGHT } from "../constants"; import { NAVIGATION_HEIGHT } from "../constants";
import { StyledButton } from "../Toolbar/Toolbar";
import type { WorkbookState } from "../workbookState"; import type { WorkbookState } from "../workbookState";
import SheetListMenu from "./SheetListMenu"; import SheetListMenu from "./SheetListMenu";
import SheetTab from "./SheetTab"; import SheetTab from "./SheetTab";

View File

@@ -4,8 +4,8 @@ import type {
HorizontalAlignment, HorizontalAlignment,
VerticalAlignment, VerticalAlignment,
} from "@ironcalc/wasm"; } from "@ironcalc/wasm";
import Tooltip from "@mui/material/Tooltip";
import { styled } from "@mui/material/styles"; import { styled } from "@mui/material/styles";
import Tooltip from "@mui/material/Tooltip";
import type {} from "@mui/system"; import type {} from "@mui/system";
import { import {
AlignCenter, AlignCenter,
@@ -45,13 +45,13 @@ import { ArrowMiddleFromLine } from "../../icons";
import { theme } from "../../theme"; import { theme } from "../../theme";
import BorderPicker from "../BorderPicker/BorderPicker"; import BorderPicker from "../BorderPicker/BorderPicker";
import ColorPicker from "../ColorPicker/ColorPicker"; import ColorPicker from "../ColorPicker/ColorPicker";
import { TOOLBAR_HEIGHT } from "../constants";
import FormatMenu from "../FormatMenu/FormatMenu"; import FormatMenu from "../FormatMenu/FormatMenu";
import { import {
NumberFormats,
decreaseDecimalPlaces, decreaseDecimalPlaces,
increaseDecimalPlaces, increaseDecimalPlaces,
NumberFormats,
} from "../FormatMenu/formatUtil"; } from "../FormatMenu/formatUtil";
import { TOOLBAR_HEIGHT } from "../constants";
type ToolbarProperties = { type ToolbarProperties = {
canUndo: boolean; canUndo: boolean;

View File

@@ -7,10 +7,20 @@ import type {
import { styled } from "@mui/material/styles"; import { styled } from "@mui/material/styles";
import { t } from "i18next"; import { t } from "i18next";
import { useCallback, useEffect, useRef, useState } from "react"; import { useCallback, useEffect, useRef, useState } from "react";
import {
CLIPBOARD_ID_SESSION_STORAGE_KEY,
getNewClipboardId,
} from "../clipboard";
import { TOOLBAR_HEIGHT } from "../constants";
import FormulaBar from "../FormulaBar/FormulaBar"; import FormulaBar from "../FormulaBar/FormulaBar";
import RightDrawer, { DEFAULT_DRAWER_WIDTH } from "../RightDrawer/RightDrawer"; import RightDrawer, { DEFAULT_DRAWER_WIDTH } from "../RightDrawer/RightDrawer";
import SheetTabBar from "../SheetTabBar"; import SheetTabBar from "../SheetTabBar";
import Toolbar from "../Toolbar/Toolbar"; import Toolbar from "../Toolbar/Toolbar";
import {
getCellAddress,
getFullRangeToString,
type NavigationKey,
} from "../util";
import Worksheet from "../Worksheet/Worksheet"; import Worksheet from "../Worksheet/Worksheet";
import { import {
COLUMN_WIDTH_SCALE, COLUMN_WIDTH_SCALE,
@@ -20,16 +30,6 @@ import {
} from "../WorksheetCanvas/constants"; } from "../WorksheetCanvas/constants";
import type WorksheetCanvas from "../WorksheetCanvas/worksheetCanvas"; import type WorksheetCanvas from "../WorksheetCanvas/worksheetCanvas";
import { devicePixelRatio } from "../WorksheetCanvas/worksheetCanvas"; import { devicePixelRatio } from "../WorksheetCanvas/worksheetCanvas";
import {
CLIPBOARD_ID_SESSION_STORAGE_KEY,
getNewClipboardId,
} from "../clipboard";
import { TOOLBAR_HEIGHT } from "../constants";
import {
type NavigationKey,
getCellAddress,
getFullRangeToString,
} from "../util";
import type { WorkbookState } from "../workbookState"; import type { WorkbookState } from "../workbookState";
import useKeyboardNavigation from "./useKeyboardNavigation"; import useKeyboardNavigation from "./useKeyboardNavigation";

View File

@@ -1,5 +1,5 @@
import { type KeyboardEvent, type RefObject, useCallback } from "react"; import { type KeyboardEvent, type RefObject, useCallback } from "react";
import { type NavigationKey, isEditingKey, isNavigationKey } from "../util"; import { isEditingKey, isNavigationKey, type NavigationKey } from "../util";
export enum Border { export enum Border {
Top = "top", Top = "top",

View File

@@ -1,4 +1,4 @@
import { type Model, columnNameFromNumber } from "@ironcalc/wasm"; import { columnNameFromNumber, type Model } from "@ironcalc/wasm";
import { styled } from "@mui/material/styles"; import { styled } from "@mui/material/styles";
import { import {
forwardRef, forwardRef,
@@ -8,18 +8,18 @@ import {
useRef, useRef,
useState, useState,
} from "react"; } from "react";
import { FORMULA_BAR_HEIGHT, NAVIGATION_HEIGHT } from "../constants";
import Editor from "../Editor/Editor"; import Editor from "../Editor/Editor";
import type { Cell } from "../types";
import { import {
COLUMN_WIDTH_SCALE, COLUMN_WIDTH_SCALE,
LAST_COLUMN, LAST_COLUMN,
LAST_ROW, LAST_ROW,
ROW_HEIGH_SCALE,
outlineBackgroundColor, outlineBackgroundColor,
outlineColor, outlineColor,
ROW_HEIGH_SCALE,
} from "../WorksheetCanvas/constants"; } from "../WorksheetCanvas/constants";
import WorksheetCanvas from "../WorksheetCanvas/worksheetCanvas"; import WorksheetCanvas from "../WorksheetCanvas/worksheetCanvas";
import { FORMULA_BAR_HEIGHT, NAVIGATION_HEIGHT } from "../constants";
import type { Cell } from "../types";
import type { WorkbookState } from "../workbookState"; import type { WorkbookState } from "../workbookState";
import CellContextMenu from "./CellContextMenu"; import CellContextMenu from "./CellContextMenu";
import usePointer from "./usePointer"; import usePointer from "./usePointer";

View File

@@ -1,13 +1,13 @@
import type { Model } from "@ironcalc/wasm"; import type { Model } from "@ironcalc/wasm";
import { type PointerEvent, type RefObject, useCallback, useRef } from "react"; import { type PointerEvent, type RefObject, useCallback, useRef } from "react";
import { isInReferenceMode } from "../Editor/util"; import { isInReferenceMode } from "../Editor/util";
import type { Cell } from "../types";
import { rangeToStr } from "../util";
import type WorksheetCanvas from "../WorksheetCanvas/worksheetCanvas"; import type WorksheetCanvas from "../WorksheetCanvas/worksheetCanvas";
import { import {
headerColumnWidth, headerColumnWidth,
headerRowHeight, headerRowHeight,
} from "../WorksheetCanvas/worksheetCanvas"; } from "../WorksheetCanvas/worksheetCanvas";
import type { Cell } from "../types";
import { rangeToStr } from "../util";
import type { WorkbookState } from "../workbookState"; import type { WorkbookState } from "../workbookState";
interface PointerSettings { interface PointerSettings {

View File

@@ -5,9 +5,6 @@ import type { Cell } from "../types";
import type { WorkbookState } from "../workbookState"; import type { WorkbookState } from "../workbookState";
import { import {
COLUMN_WIDTH_SCALE, COLUMN_WIDTH_SCALE,
LAST_COLUMN,
LAST_ROW,
ROW_HEIGH_SCALE,
cellPadding, cellPadding,
defaultTextColor, defaultTextColor,
gridColor, gridColor,
@@ -17,7 +14,10 @@ import {
headerSelectedBackground, headerSelectedBackground,
headerSelectedColor, headerSelectedColor,
headerTextColor, headerTextColor,
LAST_COLUMN,
LAST_ROW,
outlineColor, outlineColor,
ROW_HEIGH_SCALE,
} from "./constants"; } from "./constants";
import { attachOutlineHandle } from "./outlineHandle"; import { attachOutlineHandle } from "./outlineHandle";
import { computeWrappedLines, hexToRGBA10Percent } from "./util"; import { computeWrappedLines, hexToRGBA10Percent } from "./util";

View File

@@ -1,5 +1,5 @@
import { readFile } from "node:fs/promises"; import { readFile } from "node:fs/promises";
import { Model, initSync } from "@ironcalc/wasm"; import { initSync, Model } from "@ironcalc/wasm";
import { expect, test } from "vitest"; import { expect, test } from "vitest";
// This is a simple test that showcases how to load the wasm module in the tests // This is a simple test that showcases how to load the wasm module in the tests

View File

@@ -1,5 +1,5 @@
import { readFile } from "node:fs/promises"; import { readFile } from "node:fs/promises";
import { type SelectedView, initSync } from "@ironcalc/wasm"; import { initSync, type SelectedView } from "@ironcalc/wasm";
import { expect, test } from "vitest"; import { expect, test } from "vitest";
import { import {
decreaseDecimalPlaces, decreaseDecimalPlaces,

View File

@@ -1,10 +1,9 @@
import type { Area, Cell } from "./types";
import { import {
type SelectedView,
columnNameFromNumber, columnNameFromNumber,
quoteName, quoteName,
type SelectedView,
} from "@ironcalc/wasm"; } from "@ironcalc/wasm";
import type { Area, Cell } from "./types";
import { LAST_COLUMN, LAST_ROW } from "./WorksheetCanvas/constants"; import { LAST_COLUMN, LAST_ROW } from "./WorksheetCanvas/constants";
/** /**

View File

@@ -1,3 +1,4 @@
import ArrowMiddleFromLine from "./arrow-middle-from-line.svg?react";
import BorderBottomIcon from "./border-bottom.svg?react"; import BorderBottomIcon from "./border-bottom.svg?react";
import BorderCenterHIcon from "./border-center-h.svg?react"; import BorderCenterHIcon from "./border-center-h.svg?react";
import BorderCenterVIcon from "./border-center-v.svg?react"; import BorderCenterVIcon from "./border-center-v.svg?react";
@@ -8,21 +9,17 @@ import BorderOuterIcon from "./border-outer.svg?react";
import BorderRightIcon from "./border-right.svg?react"; import BorderRightIcon from "./border-right.svg?react";
import BorderStyleIcon from "./border-style.svg?react"; import BorderStyleIcon from "./border-style.svg?react";
import BorderTopIcon from "./border-top.svg?react"; import BorderTopIcon from "./border-top.svg?react";
import ArrowMiddleFromLine from "./arrow-middle-from-line.svg?react";
import DeleteColumnIcon from "./delete-column.svg?react"; import DeleteColumnIcon from "./delete-column.svg?react";
import DeleteRowIcon from "./delete-row.svg?react"; import DeleteRowIcon from "./delete-row.svg?react";
import Fx from "./fx.svg?react";
import InsertColumnLeftIcon from "./insert-column-left.svg?react"; import InsertColumnLeftIcon from "./insert-column-left.svg?react";
import InsertColumnRightIcon from "./insert-column-right.svg?react"; import InsertColumnRightIcon from "./insert-column-right.svg?react";
import InsertRowAboveIcon from "./insert-row-above.svg?react"; import InsertRowAboveIcon from "./insert-row-above.svg?react";
import InsertRowBelow from "./insert-row-below.svg?react"; import InsertRowBelow from "./insert-row-below.svg?react";
import IronCalcIcon from "./ironcalc_icon.svg?react"; import IronCalcIcon from "./ironcalc_icon.svg?react";
import IronCalcIconWhite from "./ironcalc_icon_white.svg?react"; import IronCalcIconWhite from "./ironcalc_icon_white.svg?react";
import IronCalcLogo from "./orange+black.svg?react"; import IronCalcLogo from "./orange+black.svg?react";
import Fx from "./fx.svg?react";
export { export {
ArrowMiddleFromLine, ArrowMiddleFromLine,
BorderBottomIcon, BorderBottomIcon,

View File

@@ -1,6 +1,6 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { IronCalc, Model, init } from "../index"; import { IronCalc, init, Model } from "../index";
// export interface IronCalcProps {} // export interface IronCalcProps {}