Skip to content

Commit

Permalink
Biome updates (#4331)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding authored Oct 22, 2024
1 parent b1fbc9c commit 9e6676c
Show file tree
Hide file tree
Showing 100 changed files with 143 additions and 237 deletions.
2 changes: 1 addition & 1 deletion .storybook/toolbar/ThemeNextToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { BeakerIcon, CheckIcon } from "@storybook/icons";
import { useGlobals } from "@storybook/manager-api";
import { clsx } from "clsx";
import React, { type AnchorHTMLAttributes } from "react";
import type { AnchorHTMLAttributes } from "react";

import "./ThemeNextToolbar.css";

Expand Down
3 changes: 2 additions & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down Expand Up @@ -50,6 +50,7 @@
"useSemanticElements": "off"
},
"correctness": {
"noUnusedImports": "error",
"useExhaustiveDependencies": {
"level": "warn",
"options": {
Expand Down
8 changes: 7 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,18 @@ async function getViteConfig(config: UserConfig) {
resolve: {
alias: {
"@salt-ds/core": path.resolve(__dirname, "./dist/salt-ds-core"),
"@salt-ds/countries": path.resolve(
__dirname,
"./dist/salt-ds-countries",
),
"@salt-ds/data-grid": path.resolve(
__dirname,
"./dist/salt-ds-data-grid",
),
"@salt-ds/lab": path.resolve(__dirname, "./dist/salt-ds-lab"),
"@salt-ds/icons": path.resolve(__dirname, "./dist/salt-ds-icons"),
"@salt-ds/lab": path.resolve(__dirname, "./dist/salt-ds-lab"),
"@salt-ds/styles": path.resolve(__dirname, "./dist/salt-ds-styles"),
"@salt-ds/window": path.resolve(__dirname, "./dist/salt-ds-window"),
},
},
optimizeDeps: {
Expand Down
1 change: 1 addition & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"jsx": "react-jsx",
"types": ["cypress"]
},
"include": ["**/*.ts", "**/*.tsx"]
Expand Down
1 change: 0 additions & 1 deletion docs/components/LineBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { ReactNode } from "react";
import { ReplacementToken } from "./ReplacementToken";

import "./LineBlock.css";
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
"chromatic": "chromatic"
},
"dependencies": {
"@biomejs/biome": "^1.9.1",
"@biomejs/js-api": "^0.6.2",
"@biomejs/wasm-nodejs": "^1.9.1",
"@biomejs/biome": "1.9.4",
"@biomejs/js-api": "0.7.1",
"@biomejs/wasm-nodejs": "1.9.4",
"@changesets/cli": "^2.27.7",
"@cypress/code-coverage": "^3.12.35",
"@faker-js/faker": "^8.0.0",
Expand Down Expand Up @@ -127,7 +127,6 @@
"webpack-dev-server": "4.9.3",
"webpack": "5.94.0",
"recursive-readdir": "2.2.3",
"@storybook/test@npm:8.2.4": "patch:@storybook/test@npm%3A8.2.4#~/.yarn/patches/@storybook-test-npm-8.2.4-0a53c854b7.patch",
"@joshwooding/vite-plugin-react-docgen-typescript": "0.4.0"
},
"browserslist": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { ColDef } from "ag-grid-community";
import { DropdownEditor } from "./cell-editors/DropdownEditor";
import { FlagRenderer } from "./cell-renderers/FlagRenderer";

const dataGridExampleColumnsHdCompact: ColDef[] = [
Expand Down
2 changes: 1 addition & 1 deletion packages/core/scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import crypto from "node:crypto";
import fs from "node:fs";
import path, { dirname } from "node:path";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { deleteSync } from "del";
import esbuild from "esbuild";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/file-drop-zone/FileDropZoneIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type IconProps, UploadIcon } from "@salt-ds/icons";
import type { IconProps } from "@salt-ds/icons";
import { forwardRef } from "react";
import { useIcon } from "../semantic-icon-provider";
import { StatusIndicator, type ValidationStatus } from "../status-indicator";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/form-field/FormField.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useComponentCssInjection } from "@salt-ds/styles";
import { useWindow } from "@salt-ds/window";
import { clsx } from "clsx";
import { ForwardedRef, type HTMLAttributes, forwardRef } from "react";
import { type HTMLAttributes, forwardRef } from "react";
import { type A11yValueProps, FormFieldContext } from "../form-field-context";
import { capitalize, makePrefixer, useId } from "../utils";

Expand Down
8 changes: 1 addition & 7 deletions packages/core/stories/button/button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
Button,
type ButtonProps,
FlexLayout,
FlowLayout,
StackLayout,
} from "@salt-ds/core";
import { Button, FlexLayout, FlowLayout, StackLayout } from "@salt-ds/core";
import {
DownloadIcon,
SearchIcon,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/stories/card/card.qa.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Card, H1, InteractableCard, Text } from "@salt-ds/core";
import { Card, H1, Text } from "@salt-ds/core";
import type { Meta, StoryFn } from "@storybook/react";
import {
QAContainer,
Expand Down
2 changes: 0 additions & 2 deletions packages/core/stories/floating-platform/NewWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { WindowProvider, useWindow } from "@salt-ds/window";
import {
type ComponentPropsWithoutRef,
type ForwardedRef,
createContext,
forwardRef,
useContext,
useMemo,
useState,
} from "react";
Expand Down
7 changes: 1 addition & 6 deletions packages/core/stories/form-field/form-field.qa.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
FormField,
FormFieldHelperText,
FormFieldLabel,
Input,
} from "@salt-ds/core";
import { FormField, FormFieldHelperText, FormFieldLabel } from "@salt-ds/core";
import type { Meta, StoryFn } from "@storybook/react";
import {
QAContainer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "@salt-ds/core";
import { NotificationIcon } from "@salt-ds/icons";
import type { Meta, StoryFn } from "@storybook/react";
import React, { useState } from "react";
import { useState } from "react";

import "./navigation-item.stories.css";

Expand Down
24 changes: 1 addition & 23 deletions packages/core/stories/patterns/forms/forms.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
import {
BorderItem,
BorderLayout,
Button,
Drawer,
Dropdown,
FlexItem,
FlexLayout,
FormField,
FormFieldHelperText,
FormFieldLabel,
GridItem,
GridLayout,
H1,
H2,
Input,
Label,
MultilineInput,
NavigationItem,
Option,
RadioButton,
RadioButtonGroup,
StackLayout,
Text,
} from "@salt-ds/core";
import {
CloseIcon,
GithubIcon,
MenuIcon,
StackoverflowIcon,
SymphonyIcon,
} from "@salt-ds/icons";
import type { Meta } from "@storybook/react";
import {
type ChangeEvent,
FC,
HTMLAttributes,
ReactNode,
useState,
} from "react";
import { type ChangeEvent, useState } from "react";

export default {
title: "Patterns/Forms",
Expand Down
12 changes: 1 addition & 11 deletions packages/core/stories/patterns/navigation/navigation.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@ import {
NavigationItem,
StackLayout,
} from "@salt-ds/core";
import {
GithubIcon,
LineChartIcon,
NotificationIcon,
PinIcon,
ReceiptIcon,
SearchIcon,
StackoverflowIcon,
SymphonyIcon,
UserIcon,
} from "@salt-ds/icons";
import { GithubIcon, StackoverflowIcon, SymphonyIcon } from "@salt-ds/icons";
import type { Meta } from "@storybook/react";
import { useEffect, useState } from "react";
import logo from "../../assets/logo.svg";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { LazyCountrySymbol, countryMetaMap } from "@salt-ds/countries";
import type { CountryCode } from "@salt-ds/countries";
import type { Meta, StoryFn } from "@storybook/react";
import { QAContainer } from "docs/components";
import { Suspense } from "react";

export default {
Expand Down
1 change: 0 additions & 1 deletion packages/data-grid/src/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { makePrefixer } from "@salt-ds/core";
import { useComponentCssInjection } from "@salt-ds/styles";
import { useWindow } from "@salt-ds/window";
import { clsx } from "clsx";
import type React from "react";
import {
type CSSProperties,
type KeyboardEvent,
Expand Down
2 changes: 0 additions & 2 deletions packages/data-grid/src/__tests__/__e2e__/Grid.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { ColumnGroup, Grid, GridColumn, SortOrder } from "@salt-ds/data-grid";
import { Investor, db } from "@stories/dummyData";
import * as cellCustomizationStories from "@stories/grid-cellCustomization.stories";
import * as cellValidationStories from "@stories/grid-cellValidation.stories";
import * as columnGroupsStories from "@stories/grid-columnGroups.stories";
Expand Down
4 changes: 2 additions & 2 deletions packages/data-grid/stories/grid-columnGroups.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ColumnGroup, Grid, GridColumn, GridProps } from "../src";
import { DummyRow, dummyRowKeyGetter, rowData } from "./dummyData";
import { ColumnGroup, Grid, GridColumn } from "../src";
import { dummyRowKeyGetter, rowData } from "./dummyData";
import "./grid.stories.css";
import type { StoryFn } from "@storybook/react";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ToggleButton,
ToggleButtonGroup,
} from "@salt-ds/core";
import { ArrowDownIcon, ArrowUpIcon, HomeIcon, MenuIcon } from "@salt-ds/icons";
import { ArrowDownIcon, ArrowUpIcon, MenuIcon } from "@salt-ds/icons";
import { MenuButton } from "@salt-ds/lab";
import {
type SyntheticEvent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { FlexLayout } from "@salt-ds/core";
import { useState } from "react";
import {
Grid,
GridColumn,
GridProps,
RowSelectionCheckboxColumn,
} from "../src";
import { DummyRow, dummyRowKeyGetter, rowData } from "./dummyData";
import { Grid, GridColumn, RowSelectionCheckboxColumn } from "../src";
import { dummyRowKeyGetter, rowData } from "./dummyData";
import "./grid.stories.css";
import type { StoryFn } from "@storybook/react";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
startOfMonth,
today,
} from "@internationalized/date";
import { type CalendarProps, formatDate, getCurrentLocale } from "@salt-ds/lab";
import { type CalendarProps, formatDate } from "@salt-ds/lab";
import * as calendarStories from "@stories/calendar/calendar.stories";
import { composeStories } from "@storybook/react";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from "@internationalized/date";
import * as datePickerStories from "@stories/date-picker/date-picker.stories";
import { composeStories } from "@storybook/react";
import React from "react";
import { formatDate } from "../../../calendar";
import { parseZonedDateTime } from "../../../date-input";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from "@internationalized/date";
import * as datePickerStories from "@stories/date-picker/date-picker.stories";
import { composeStories } from "@storybook/react";
import React from "react";
import { formatDate } from "../../../calendar";
import { parseZonedDateTime } from "../../../date-input";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { List, ListItem, ListItemProps } from "@salt-ds/lab";
import { List, ListItem } from "@salt-ds/lab";
import { version } from "react";

describe("A declarative list", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/lab/src/contact-details/internal/StarIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef } from "react";
import { forwardRef } from "react";

const filledPath =
"M6,0,4.21,4.05,0,4.58l3.11,3L2.29,12,6,9.5,9.71,12,8.89,7.62l3.11-3L7.79,4.05,6,0Z";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { makePrefixer } from "@salt-ds/core";
import { clsx } from "clsx";
import React, { forwardRef, type HTMLAttributes } from "react";
import { type HTMLAttributes, forwardRef } from "react";
import { StarIcon } from "./StarIcon";

const withBaseName = makePrefixer("saltContactFavoriteToggle");
Expand Down
8 changes: 4 additions & 4 deletions packages/lab/src/date-picker/DatePickerActions.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Button, type ButtonProps, makePrefixer } from "@salt-ds/core";
import { clsx } from "clsx";
import React, {
import {
type ComponentPropsWithoutRef,
forwardRef,
useEffect,
type SyntheticEvent,
type MouseEventHandler,
type Ref,
type SyntheticEvent,
forwardRef,
useEffect,
} from "react";
import type { DateRangeSelection, SingleDateSelection } from "../calendar";
import {
Expand Down
4 changes: 2 additions & 2 deletions packages/lab/src/editable-label/EditableLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useControlled, useIsomorphicLayoutEffect } from "@salt-ds/core";
import { clsx } from "clsx";
import React, {
import {
type ChangeEvent,
type ForwardedRef,
forwardRef,
type KeyboardEvent,
type ReactElement,
forwardRef,
useCallback,
useRef,
} from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useIsomorphicLayoutEffect } from "@salt-ds/core";
import React, { createContext, useContext, useState, useRef } from "react";
import { createContext, useContext, useRef, useState } from "react";

// //////////////////////////////////////////////////////////////////////////////
// SUPER HACKS AHEAD: The React team will hate this enough to hopefully give us
Expand Down
1 change: 0 additions & 1 deletion packages/lab/src/list-deprecated/internal/Highlighter.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { escapeRegExp } from "../../utils";

import { useComponentCssInjection } from "@salt-ds/styles";
Expand Down
9 changes: 4 additions & 5 deletions packages/lab/src/responsive/overflowUtils.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {
type ElementRef,
type OverflowItem,
collapsibleType,
type orientationType,
import type {
ElementRef,
OverflowItem,
orientationType,
} from "./overflowTypes";

export const DropdownPlaceholder = () => null;
Expand Down
1 change: 0 additions & 1 deletion packages/lab/src/static-list/StaticListItemContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useWindow } from "@salt-ds/window";
import { clsx } from "clsx";
import {
type ComponentPropsWithoutRef,
type ForwardedRef,
type ReactNode,
forwardRef,
} from "react";
Expand Down
1 change: 0 additions & 1 deletion packages/lab/src/stepper-input/StepperInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
useFormFieldProps,
useIcon,
} from "@salt-ds/core";
import { TriangleDownIcon, TriangleUpIcon } from "@salt-ds/icons";
import { useComponentCssInjection } from "@salt-ds/styles";
import { useWindow } from "@salt-ds/window";
import { clsx } from "clsx";
Expand Down
2 changes: 1 addition & 1 deletion packages/lab/src/tabs/TabActivationIndicator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makePrefixer } from "@salt-ds/core";
import React, { useRef } from "react";
import { useRef } from "react";

import { useActivationIndicator } from "./useActivationIndicator";

Expand Down
Loading

0 comments on commit 9e6676c

Please sign in to comment.