From 0d696241cef92fb51105d7271b13a12f9091cdd3 Mon Sep 17 00:00:00 2001 From: Alexandre Philibeaux Date: Tue, 10 Dec 2024 23:24:01 +0100 Subject: [PATCH] chore(oxlint): update config Signed-off-by: Alexandre Philibeaux --- .github/workflows/ci.yml | 18 ++-- .github/workflows/fonts-upload.yml | 2 +- .oxlintrc.json | 40 ++++----- biome.json | 1 + eslint.config.mjs | 2 +- expect.d.ts | 5 +- package.json | 4 +- .../CheckboxField/__tests__/index.test.tsx | 2 +- .../DateField/__tests__/index.test.tsx | 2 +- .../components/Form/__tests__/index.test.tsx | 2 +- .../NumberInputField/__tests__/index.test.tsx | 2 +- .../__tests__/index.test.tsx | 2 +- .../__tests__/index.test.tsx | 2 +- .../__tests__/index.test.tsx | 2 +- .../SliderField/__tests__/index.test.tsx | 2 +- .../Submit/__tests__/index.test.tsx | 2 +- .../SubmitErrorAlert/__tests__/index.test.tsx | 2 +- .../__tests__/index.test.tsx | 2 +- .../TagInputField/__tests__/index.test.tsx | 2 +- .../TextAreaField/__tests__/index.test.tsx | 2 +- .../TextInputField/__tests__/index.test.tsx | 2 +- .../TextInputFieldV2/__tests__/index.test.tsx | 2 +- .../UnitInputField/__tests__/index.test.tsx | 2 +- .../src/components/CodeEditor/CodeEditor.tsx | 2 +- .../__tests__/index.test.tsx | 2 +- .../EstimateCost/Components/Item.tsx | 3 +- .../__tests__/CustomUnitInput.test.tsx | 2 +- .../EstimateCost/__tests__/Regular.test.tsx | 2 +- .../EstimateCost/__tests__/Unit.test.tsx | 2 +- .../SteppedListCard/__tests__/index.test.tsx | 2 +- .../Tools/ThemeGenerator/helpers.ts | 2 +- .../components/Alert/__tests__/index.test.tsx | 2 +- .../AvatarV2/__tests__/index.test.tsx | 2 +- .../Banner/__tests__/index.test.tsx | 2 +- .../BarChart/__tests__/index.test.tsx | 2 +- .../BarStack/__tests__/index.test.tsx | 2 +- .../Breadcrumbs/__tests__/index.test.tsx | 2 +- .../Carousel/__tests__/index.test.tsx | 2 +- .../Checkbox/__tests__/index.test.tsx | 2 +- .../components/Chip/__tests__/index.test.tsx | 2 +- .../CopyButton/__tests__/index.test.tsx | 2 +- .../DateInput/__tests__/index.test.tsx | 2 +- .../Dialog/__tests__/index.test.tsx | 2 +- .../Drawer/__tests__/index.test.tsx | 2 +- .../ExpandableCard/__tests__/index.test.tsx | 2 +- .../GlobalAlert/__tests__/index.test.tsx | 2 +- .../LineChart/__tests__/index.test.tsx | 2 +- .../List/__stories__/Context.stories.tsx | 24 ++---- .../List/__stories__/Overflow.stories.tsx | 26 +++--- .../components/List/__tests__/index.test.tsx | 2 +- .../components/Menu/__tests__/index.test.tsx | 2 +- .../MenuV2/__tests__/index.test.tsx | 2 +- .../components/Modal/__tests__/index.test.tsx | 2 +- .../NumberInput/__tests__/index.test.tsx | 2 +- .../NumberInputV2/__tests__/index.test.tsx | 2 +- .../Pagination/__tests__/index.test.tsx | 2 +- .../PieChart/__tests__/index.test.tsx | 2 +- .../Popover/__tests__/index.test.tsx | 2 +- .../components/Popup/__tests__/index.test.tsx | 2 +- .../SearchInput/__tests__/index.test.tsx | 2 +- .../SelectInput/__tests__/index.test.tsx | 2 +- .../SelectInputV2/__tests__/index.test.tsx | 2 +- .../SelectableCard/__tests__/index.test.tsx | 2 +- .../Slider/__tests__/doubleSlider.test.tsx | 2 +- .../Slider/__tests__/singleSlider.test.tsx | 2 +- .../Snippet/__tests__/index.test.tsx | 2 +- .../Stepper/__tests__/index.test.tsx | 2 +- .../SwitchButton/__tests__/index.test.tsx | 2 +- .../Table/__stories__/Style.stories.tsx | 14 ++-- .../components/Table/__tests__/index.test.tsx | 2 +- .../TagInput/__tests__/index.test.tsx | 2 +- .../TagList/__tests__/index.test.tsx | 2 +- .../TextArea/__tests__/index.test.tsx | 2 +- .../TextInput/__tests__/index.test.tsx | 2 +- .../TextInputV2/__tests__/index.test.tsx | 2 +- .../Toggle/__tests__/index.test.tsx | 2 +- .../Tooltip/__tests__/index.test.tsx | 2 +- .../UnitInput/__tests__/index.test.tsx | 2 +- .../src/components/VerificationCode/index.tsx | 2 +- packages/ui/src/emotion.d.ts | 3 +- pnpm-lock.yaml | 84 +++++++++---------- scripts/figma-synchronise-tokens.mjs | 5 +- utils/test/src/vitest/mockFormErrors.ts | 11 +++ utils/test/src/vitest/mockMatchMedia.ts | 2 +- utils/test/src/vitest/resetUserEvent.tsx | 2 +- utils/test/src/vitest/setup.ts | 2 + 86 files changed, 191 insertions(+), 193 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4f4893eff..347a211b26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: node-version: 22 cache: "pnpm" - run: | - pnpm install + pnpm install --frozen-lockfile pnpm exec manypkg check typecheck: runs-on: ubuntu-24.04 @@ -39,7 +39,7 @@ jobs: node-version: 22 cache: "pnpm" - run: | - pnpm install + pnpm install --frozen-lockfile pnpm typecheck oxlint: @@ -56,9 +56,9 @@ jobs: node-version: 22 cache: "pnpm" - run: | - pnpm install + pnpm install --frozen-lockfile pnpm build - pnpm oxlint -c .oxlintrc.json + pnpm oxlint -c .oxlintrc.json --quiet lint: runs-on: ubuntu-24.04 @@ -74,7 +74,7 @@ jobs: node-version: 22 cache: "pnpm" - run: | - pnpm install + pnpm install --frozen-lockfile pnpm build pnpm run lint @@ -92,7 +92,7 @@ jobs: node-version: 22 cache: "pnpm" - run: | - pnpm install + pnpm install --frozen-lockfile pnpm run format:ci test: @@ -115,7 +115,7 @@ jobs: node-version: ${{ matrix.node }} cache: "pnpm" - run: | - pnpm install + pnpm install --frozen-lockfile pnpm run test:unit:coverage - uses: codecov/codecov-action@v5.1.1 with: @@ -156,7 +156,7 @@ jobs: with: node-version: ${{ matrix.node }} - run: | - pnpm install + pnpm install --frozen-lockfile pnpm run build publint: @@ -173,7 +173,7 @@ jobs: node-version: 22 cache: "pnpm" - run: | - pnpm install + pnpm install --frozen-lockfile pnpm publint deploy: diff --git a/.github/workflows/fonts-upload.yml b/.github/workflows/fonts-upload.yml index b6a8d6ab08..d3e486bdc9 100644 --- a/.github/workflows/fonts-upload.yml +++ b/.github/workflows/fonts-upload.yml @@ -28,7 +28,7 @@ jobs: with: node-version: 22 cache: "pnpm" - - run: pnpm install + - run: pnpm install --frozen-lockfile - name: Install aws CLI run: | diff --git a/.oxlintrc.json b/.oxlintrc.json index e080a00fc1..a5fae04383 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -2,42 +2,46 @@ "$schema": "./node_modules/oxlint/configuration_schema.json", "categories": { "correctness": "error", - "style": "error", - "suspicious": "error", - "perf": "error", + "nursery": "off", "pedantic": "error", + "perf": "error", "restriction": "error", - "nursery": "off" + "style": "error", + "suspicious": "error" }, "plugins": [ "import", + "n", "node", - "react", "react-perf", + "react", "security", - "n", "tree_shaking", "typescript", - "unicorn", - "vitest" + "unicorn" ], "overrides": [ { - "files": ["**/__stories__/**/*.{ts,tsx}"], + "files": ["**/__stories__/**/*.{ts,tsx}", "**/__tests__/**/*.{ts,tsx}"], "rules": { "react/jsx-key": "off", "no-console": "off", "no-alert": "off" } + }, + { + "files": ["**/__tests__/**/*.{ts,tsx}", "setup.ts"], + "plugins": ["vitest"] } ], "rules": { - "@typescript-eslint/ban-tslint-comment": "off", + "@typescript/no-explicit-any": "warn", + "@typescript-eslint/no-unused-expressions": "warn", + "@typescript-eslint/ban-tslint-comment": "warn", "@typescript-eslint/consistent-indexed-object-style": "error", "@typescript-eslint/consistent-type-definitions": ["error", "type"], "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/no-explicit-any": "warn", - "@typescript/no-explicit-any": "warn", "@typescript-eslint/prefer-enum-initializers": "off", "@typescript-eslint/prefer-function-type": "off", "@typescript-eslint/prefer-literal-enum-member": "off", @@ -49,10 +53,8 @@ "eslint/no-empty-function": "off", "eslint/no-magic-numbers": "off", "eslint/no-ternary": "off", - "eslint/no-undef": "off", "eslint/no-undefined": "off", "eslint/sort-keys": "off", - "eslint/react-in-jsx-scope": "off", "eslint/no-unused-vars": [ "error", { @@ -67,26 +69,18 @@ "memberSyntaxSortOrder": ["single", "multiple", "all", "none"] } ], - "import/export": "off", - "import/import-no-namespace": "off", + "eslint/yoda": "error", + "import/no-namespace": "off", "import/max-dependencies": "off", "import/namespace": "off", "import/no-default-export": "off", - "import/no-deprecated": "warn", "import/no-duplicates": "off", - "import/no-unused-modules": "off", "import/unambiguous": "warn", - "oxc/no-accumulating-spread": "off", - "oxc/no-async-await": "off", - "oxc/no-barrel-file": "off", - "oxc/no-optional-chaining": "off", - "oxc/no-rest-spread-properties": "off", "react-perf/jsx-no-jsx-as-prop": "off", "react-perf/jsx-no-new-array-as-prop": "off", "react-perf/jsx-no-new-function-as-prop": "off", "react-perf/jsx-no-new-object-as-prop": "off", "react/jsx-no-useless-fragment": "off", - "react/exhaustive-deps": "warn", "react/iframe-missing-sandbox": "warn", "react/jsx-no-target-blank": "off", "react/react-in-jsx-scope": "off", diff --git a/biome.json b/biome.json index 804fe4dcda..9c4299706d 100644 --- a/biome.json +++ b/biome.json @@ -12,6 +12,7 @@ }, "files": { "ignore": [ + ".turbo/", ".next/", "coverage/", "**/node_modules/", diff --git a/eslint.config.mjs b/eslint.config.mjs index 5471c3c7ca..59bc2c34c0 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -180,5 +180,5 @@ export default [ ], ...testingLibrary.configs['flat/react'], }, - oxlint.configs['flat/all'], + ...oxlint.buildFromOxlintConfigFile('.oxlintrc.json'), ] diff --git a/expect.d.ts b/expect.d.ts index 99f845a9cd..5f3c11fb99 100644 --- a/expect.d.ts +++ b/expect.d.ts @@ -1,8 +1,7 @@ import 'expect' declare module 'expect' { - interface Matchers, T = unknown> - extends jest.Matchers { + type Matchers, T = unknown> = { toHaveNoViolations(): R - } + } & jest.Matchers } diff --git a/package.json b/package.json index 18d2d3f9b0..d2781344c3 100644 --- a/package.json +++ b/package.json @@ -154,7 +154,7 @@ "emoji-toolkit": "9.0.1", "esbuild-plugin-browserslist": "0.15.0", "eslint": "9.16.0", - "eslint-plugin-oxlint": "0.14.1", + "eslint-plugin-oxlint": "0.15.0", "eslint-plugin-testing-library": "7.1.1", "expect": "29.7.0", "file-loader": "6.2.0", @@ -165,7 +165,7 @@ "identity-obj-proxy": "3.0.0", "jest-axe": "9.0.0", "lint-staged": "15.2.11", - "oxlint": "0.13.2", + "oxlint": "0.15.0", "postcss": "8.4.49", "publint": "0.2.12", "react": "18.3.1", diff --git a/packages/form/src/components/CheckboxField/__tests__/index.test.tsx b/packages/form/src/components/CheckboxField/__tests__/index.test.tsx index 797622cfc7..f9a58edb39 100644 --- a/packages/form/src/components/CheckboxField/__tests__/index.test.tsx +++ b/packages/form/src/components/CheckboxField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { act, renderHook, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { mockFormErrors, renderWithForm, renderWithTheme } from '@utils/test' import { useForm } from 'react-hook-form' import { describe, expect, test, vi } from 'vitest' diff --git a/packages/form/src/components/DateField/__tests__/index.test.tsx b/packages/form/src/components/DateField/__tests__/index.test.tsx index 325bda2544..c5588382e7 100644 --- a/packages/form/src/components/DateField/__tests__/index.test.tsx +++ b/packages/form/src/components/DateField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithForm } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { DateField } from '..' diff --git a/packages/form/src/components/Form/__tests__/index.test.tsx b/packages/form/src/components/Form/__tests__/index.test.tsx index f1e7bb49cf..906432957d 100644 --- a/packages/form/src/components/Form/__tests__/index.test.tsx +++ b/packages/form/src/components/Form/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { renderHook, screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { mockFormErrors, renderWithTheme } from '@utils/test' import { useForm } from 'react-hook-form' import { describe, expect, test, vi } from 'vitest' diff --git a/packages/form/src/components/NumberInputField/__tests__/index.test.tsx b/packages/form/src/components/NumberInputField/__tests__/index.test.tsx index 12498aa6e6..7a8bf9b6cd 100644 --- a/packages/form/src/components/NumberInputField/__tests__/index.test.tsx +++ b/packages/form/src/components/NumberInputField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { act, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithForm } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { NumberInputField } from '../..' diff --git a/packages/form/src/components/NumberInputFieldV2/__tests__/index.test.tsx b/packages/form/src/components/NumberInputFieldV2/__tests__/index.test.tsx index 7ee01213ff..46233530e0 100644 --- a/packages/form/src/components/NumberInputFieldV2/__tests__/index.test.tsx +++ b/packages/form/src/components/NumberInputFieldV2/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { act, renderHook, screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { mockFormErrors, renderWithForm, renderWithTheme } from '@utils/test' import { useForm } from 'react-hook-form' import { describe, expect, test, vi } from 'vitest' diff --git a/packages/form/src/components/SelectInputFieldV2/__tests__/index.test.tsx b/packages/form/src/components/SelectInputFieldV2/__tests__/index.test.tsx index 1702df4345..02e6efd553 100644 --- a/packages/form/src/components/SelectInputFieldV2/__tests__/index.test.tsx +++ b/packages/form/src/components/SelectInputFieldV2/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { act, fireEvent, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithForm } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { SelectInputFieldV2 } from '..' diff --git a/packages/form/src/components/SelectableCardField/__tests__/index.test.tsx b/packages/form/src/components/SelectableCardField/__tests__/index.test.tsx index 4f24c4a81f..c5618c845a 100644 --- a/packages/form/src/components/SelectableCardField/__tests__/index.test.tsx +++ b/packages/form/src/components/SelectableCardField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { act, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithForm } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { SelectableCardField } from '../..' diff --git a/packages/form/src/components/SliderField/__tests__/index.test.tsx b/packages/form/src/components/SliderField/__tests__/index.test.tsx index 486a7713ba..95ed49e4c9 100644 --- a/packages/form/src/components/SliderField/__tests__/index.test.tsx +++ b/packages/form/src/components/SliderField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { act, fireEvent, renderHook, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { mockFormErrors, renderWithForm, renderWithTheme } from '@utils/test' import { useForm } from 'react-hook-form' import { describe, expect, test, vi } from 'vitest' diff --git a/packages/form/src/components/Submit/__tests__/index.test.tsx b/packages/form/src/components/Submit/__tests__/index.test.tsx index f601ff69f6..989e0bfcef 100644 --- a/packages/form/src/components/Submit/__tests__/index.test.tsx +++ b/packages/form/src/components/Submit/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithForm } from '@utils/test' import { describe, expect, test } from 'vitest' import { Submit, TextInputField } from '../..' diff --git a/packages/form/src/components/SubmitErrorAlert/__tests__/index.test.tsx b/packages/form/src/components/SubmitErrorAlert/__tests__/index.test.tsx index 11aa3c78b4..6c4bf03104 100644 --- a/packages/form/src/components/SubmitErrorAlert/__tests__/index.test.tsx +++ b/packages/form/src/components/SubmitErrorAlert/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithForm } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { Submit, SubmitErrorAlert } from '../..' diff --git a/packages/form/src/components/SwitchButtonField/__tests__/index.test.tsx b/packages/form/src/components/SwitchButtonField/__tests__/index.test.tsx index 52f2400306..aa9534836f 100644 --- a/packages/form/src/components/SwitchButtonField/__tests__/index.test.tsx +++ b/packages/form/src/components/SwitchButtonField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { renderHook, screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithForm, renderWithTheme } from '@utils/test' import { useForm } from 'react-hook-form' import { describe, expect, test, vi } from 'vitest' diff --git a/packages/form/src/components/TagInputField/__tests__/index.test.tsx b/packages/form/src/components/TagInputField/__tests__/index.test.tsx index 929c2489e7..6b106c7a0a 100644 --- a/packages/form/src/components/TagInputField/__tests__/index.test.tsx +++ b/packages/form/src/components/TagInputField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { renderHook, screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithForm, renderWithTheme } from '@utils/test' import { useForm } from 'react-hook-form' import { describe, expect, test, vi } from 'vitest' diff --git a/packages/form/src/components/TextAreaField/__tests__/index.test.tsx b/packages/form/src/components/TextAreaField/__tests__/index.test.tsx index be0a482d53..4868511438 100644 --- a/packages/form/src/components/TextAreaField/__tests__/index.test.tsx +++ b/packages/form/src/components/TextAreaField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { renderHook, screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { mockFormErrors, renderWithForm, renderWithTheme } from '@utils/test' import { useForm } from 'react-hook-form' import { describe, expect, test, vi } from 'vitest' diff --git a/packages/form/src/components/TextInputField/__tests__/index.test.tsx b/packages/form/src/components/TextInputField/__tests__/index.test.tsx index e641a532f1..9f61d32301 100644 --- a/packages/form/src/components/TextInputField/__tests__/index.test.tsx +++ b/packages/form/src/components/TextInputField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { mockFormErrors, renderWithForm } from '@utils/test' import { describe, expect, test } from 'vitest' import { TextInputField } from '..' diff --git a/packages/form/src/components/TextInputFieldV2/__tests__/index.test.tsx b/packages/form/src/components/TextInputFieldV2/__tests__/index.test.tsx index 57e48cb0f1..e6b80e0396 100644 --- a/packages/form/src/components/TextInputFieldV2/__tests__/index.test.tsx +++ b/packages/form/src/components/TextInputFieldV2/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { renderHook, screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { mockFormErrors, renderWithForm, renderWithTheme } from '@utils/test' import { useForm } from 'react-hook-form' import { describe, expect, test, vi } from 'vitest' diff --git a/packages/form/src/components/UnitInputField/__tests__/index.test.tsx b/packages/form/src/components/UnitInputField/__tests__/index.test.tsx index 3f2b9086bf..731643e12e 100644 --- a/packages/form/src/components/UnitInputField/__tests__/index.test.tsx +++ b/packages/form/src/components/UnitInputField/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { renderHook, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithForm, renderWithTheme } from '@utils/test' import { useForm } from 'react-hook-form' import { describe, expect, test, vi } from 'vitest' diff --git a/packages/plus/src/components/CodeEditor/CodeEditor.tsx b/packages/plus/src/components/CodeEditor/CodeEditor.tsx index 15248a1a6a..b1ffdbc293 100644 --- a/packages/plus/src/components/CodeEditor/CodeEditor.tsx +++ b/packages/plus/src/components/CodeEditor/CodeEditor.tsx @@ -8,7 +8,7 @@ import type { ComponentProps } from 'react' const StyledText = styled(Text)` background-color: ${({ theme }) => theme.colors.neutral.backgroundStrong}; padding: ${({ theme }) => `${theme.space['1']} ${theme.space['2']}`}; - border-radius: ${({ theme }) => theme.radii.default}; + border-radius: ${({ theme }) => `${theme.radii.default}`}; width: 100%; ` diff --git a/packages/plus/src/components/CustomerSatisfaction/__tests__/index.test.tsx b/packages/plus/src/components/CustomerSatisfaction/__tests__/index.test.tsx index c5559a5ba9..9d38b7204d 100644 --- a/packages/plus/src/components/CustomerSatisfaction/__tests__/index.test.tsx +++ b/packages/plus/src/components/CustomerSatisfaction/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme } from '@utils/test' import { describe, expect, it, vi } from 'vitest' import { CustomerSatisfaction } from '..' diff --git a/packages/plus/src/components/EstimateCost/Components/Item.tsx b/packages/plus/src/components/EstimateCost/Components/Item.tsx index e67d30dd02..981ce7d458 100644 --- a/packages/plus/src/components/EstimateCost/Components/Item.tsx +++ b/packages/plus/src/components/EstimateCost/Components/Item.tsx @@ -217,8 +217,7 @@ type ItemProps = { | 'months' | 'years' // Allow a string for unit but keep autocomplete for the above values - // oxlint-disable-next-line typescript-eslint(ban-types) - | (string & {}) + | (string & NonNullable) } const StyleNoPriceItem = styled(Text)` diff --git a/packages/plus/src/components/EstimateCost/__tests__/CustomUnitInput.test.tsx b/packages/plus/src/components/EstimateCost/__tests__/CustomUnitInput.test.tsx index 44c7a8a362..3a7ea98da3 100644 --- a/packages/plus/src/components/EstimateCost/__tests__/CustomUnitInput.test.tsx +++ b/packages/plus/src/components/EstimateCost/__tests__/CustomUnitInput.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { resetIntersectionMocking, diff --git a/packages/plus/src/components/EstimateCost/__tests__/Regular.test.tsx b/packages/plus/src/components/EstimateCost/__tests__/Regular.test.tsx index 66992c96ef..e9b358291d 100644 --- a/packages/plus/src/components/EstimateCost/__tests__/Regular.test.tsx +++ b/packages/plus/src/components/EstimateCost/__tests__/Regular.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { resetIntersectionMocking, diff --git a/packages/plus/src/components/EstimateCost/__tests__/Unit.test.tsx b/packages/plus/src/components/EstimateCost/__tests__/Unit.test.tsx index b2e5d5aef1..2fb5886041 100644 --- a/packages/plus/src/components/EstimateCost/__tests__/Unit.test.tsx +++ b/packages/plus/src/components/EstimateCost/__tests__/Unit.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { resetIntersectionMocking, diff --git a/packages/plus/src/components/SteppedListCard/__tests__/index.test.tsx b/packages/plus/src/components/SteppedListCard/__tests__/index.test.tsx index d017817c13..ac52c47b8d 100644 --- a/packages/plus/src/components/SteppedListCard/__tests__/index.test.tsx +++ b/packages/plus/src/components/SteppedListCard/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { blockStorageWire } from '@ultraviolet/illustrations/products/blockStorage' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, it, test } from 'vitest' diff --git a/packages/ui/src/__stories__/Tools/ThemeGenerator/helpers.ts b/packages/ui/src/__stories__/Tools/ThemeGenerator/helpers.ts index 471a4190d5..5300c5e8ad 100644 --- a/packages/ui/src/__stories__/Tools/ThemeGenerator/helpers.ts +++ b/packages/ui/src/__stories__/Tools/ThemeGenerator/helpers.ts @@ -1,5 +1,5 @@ +// eslint-disable no-bitwise // Function imported from https://github.com/PimpTrizkit/PJs/wiki/12.-Shade,-Blend-and-Convert-a-Web-Color-(pSBC.js)#stackoverflow-archive-begin to shade hexa colors -// oxlint-disable no-bitwise type ShadeHexColorType = (color: string, percent: number) => string diff --git a/packages/ui/src/components/Alert/__tests__/index.test.tsx b/packages/ui/src/components/Alert/__tests__/index.test.tsx index 87507259e2..eb47a929de 100644 --- a/packages/ui/src/components/Alert/__tests__/index.test.tsx +++ b/packages/ui/src/components/Alert/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest' import { ALERT_SENTIMENTS, Alert } from '..' diff --git a/packages/ui/src/components/AvatarV2/__tests__/index.test.tsx b/packages/ui/src/components/AvatarV2/__tests__/index.test.tsx index 94928f50d8..698aa065b8 100644 --- a/packages/ui/src/components/AvatarV2/__tests__/index.test.tsx +++ b/packages/ui/src/components/AvatarV2/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, it, vi } from 'vitest' import { AvatarV2 } from '..' diff --git a/packages/ui/src/components/Banner/__tests__/index.test.tsx b/packages/ui/src/components/Banner/__tests__/index.test.tsx index 38155fec0b..30adf95535 100644 --- a/packages/ui/src/components/Banner/__tests__/index.test.tsx +++ b/packages/ui/src/components/Banner/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test } from 'vitest' import { Banner } from '..' diff --git a/packages/ui/src/components/BarChart/__tests__/index.test.tsx b/packages/ui/src/components/BarChart/__tests__/index.test.tsx index afc622095e..d7265a9b5d 100644 --- a/packages/ui/src/components/BarChart/__tests__/index.test.tsx +++ b/packages/ui/src/components/BarChart/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import * as nivo from '@nivo/core' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import type { ComponentProps } from 'react' import { beforeAll, describe, test, vi } from 'vitest' diff --git a/packages/ui/src/components/BarStack/__tests__/index.test.tsx b/packages/ui/src/components/BarStack/__tests__/index.test.tsx index 750cef215d..483ffb60bb 100644 --- a/packages/ui/src/components/BarStack/__tests__/index.test.tsx +++ b/packages/ui/src/components/BarStack/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { BarStack } from '..' diff --git a/packages/ui/src/components/Breadcrumbs/__tests__/index.test.tsx b/packages/ui/src/components/Breadcrumbs/__tests__/index.test.tsx index a4f56c4f72..6c75bcac68 100644 --- a/packages/ui/src/components/Breadcrumbs/__tests__/index.test.tsx +++ b/packages/ui/src/components/Breadcrumbs/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { Breadcrumbs } from '..' diff --git a/packages/ui/src/components/Carousel/__tests__/index.test.tsx b/packages/ui/src/components/Carousel/__tests__/index.test.tsx index e72282767f..9c52900a5a 100644 --- a/packages/ui/src/components/Carousel/__tests__/index.test.tsx +++ b/packages/ui/src/components/Carousel/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, test } from 'vitest' import { Carousel } from '..' diff --git a/packages/ui/src/components/Checkbox/__tests__/index.test.tsx b/packages/ui/src/components/Checkbox/__tests__/index.test.tsx index 639a2c7870..8d92c10fcb 100644 --- a/packages/ui/src/components/Checkbox/__tests__/index.test.tsx +++ b/packages/ui/src/components/Checkbox/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test } from 'vitest' import { Checkbox } from '..' diff --git a/packages/ui/src/components/Chip/__tests__/index.test.tsx b/packages/ui/src/components/Chip/__tests__/index.test.tsx index f2eadbcaf7..35e2c6bdc0 100644 --- a/packages/ui/src/components/Chip/__tests__/index.test.tsx +++ b/packages/ui/src/components/Chip/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { Chip } from '..' diff --git a/packages/ui/src/components/CopyButton/__tests__/index.test.tsx b/packages/ui/src/components/CopyButton/__tests__/index.test.tsx index 182f3514f7..7ee3d7ca9c 100644 --- a/packages/ui/src/components/CopyButton/__tests__/index.test.tsx +++ b/packages/ui/src/components/CopyButton/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { beforeAll, describe, expect, it, test, vi } from 'vitest' import { CopyButton } from '../index' diff --git a/packages/ui/src/components/DateInput/__tests__/index.test.tsx b/packages/ui/src/components/DateInput/__tests__/index.test.tsx index ca195f9aca..8f520f7ccb 100644 --- a/packages/ui/src/components/DateInput/__tests__/index.test.tsx +++ b/packages/ui/src/components/DateInput/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme } from '@utils/test' import { es, fr, ru } from 'date-fns/locale' import tk from 'timekeeper' diff --git a/packages/ui/src/components/Dialog/__tests__/index.test.tsx b/packages/ui/src/components/Dialog/__tests__/index.test.tsx index 6c91651eb8..5eabbf0421 100644 --- a/packages/ui/src/components/Dialog/__tests__/index.test.tsx +++ b/packages/ui/src/components/Dialog/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshotWithPortal, diff --git a/packages/ui/src/components/Drawer/__tests__/index.test.tsx b/packages/ui/src/components/Drawer/__tests__/index.test.tsx index 258203d3e7..85f7005f50 100644 --- a/packages/ui/src/components/Drawer/__tests__/index.test.tsx +++ b/packages/ui/src/components/Drawer/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { consoleLightTheme } from '@ultraviolet/themes' import { renderWithTheme, diff --git a/packages/ui/src/components/ExpandableCard/__tests__/index.test.tsx b/packages/ui/src/components/ExpandableCard/__tests__/index.test.tsx index eb41768266..2464011b82 100644 --- a/packages/ui/src/components/ExpandableCard/__tests__/index.test.tsx +++ b/packages/ui/src/components/ExpandableCard/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { ExpandableCard } from '..' diff --git a/packages/ui/src/components/GlobalAlert/__tests__/index.test.tsx b/packages/ui/src/components/GlobalAlert/__tests__/index.test.tsx index 4b02436252..5c311a290d 100644 --- a/packages/ui/src/components/GlobalAlert/__tests__/index.test.tsx +++ b/packages/ui/src/components/GlobalAlert/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test } from 'vitest' import { GlobalAlert } from '..' diff --git a/packages/ui/src/components/LineChart/__tests__/index.test.tsx b/packages/ui/src/components/LineChart/__tests__/index.test.tsx index b359559926..baf1eea966 100644 --- a/packages/ui/src/components/LineChart/__tests__/index.test.tsx +++ b/packages/ui/src/components/LineChart/__tests__/index.test.tsx @@ -2,7 +2,7 @@ import * as nivo from '@nivo/core' import { fireEvent, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import type { ComponentProps } from 'react' import { useEffect, useState } from 'react' diff --git a/packages/ui/src/components/List/__stories__/Context.stories.tsx b/packages/ui/src/components/List/__stories__/Context.stories.tsx index 3e2a368382..001681b58e 100644 --- a/packages/ui/src/components/List/__stories__/Context.stories.tsx +++ b/packages/ui/src/components/List/__stories__/Context.stories.tsx @@ -3,21 +3,15 @@ import { List } from '..' import { columns, data } from './resources' export const Context: StoryFn = args => ( - <> - - {data.map(planet => ( - - {planet.name} - {planet.perihelion}AU - {planet.aphelion}AU - - ))} - - + + {data.map(planet => ( + + {planet.name} + {planet.perihelion}AU + {planet.aphelion}AU + + ))} + ) Context.parameters = { diff --git a/packages/ui/src/components/List/__stories__/Overflow.stories.tsx b/packages/ui/src/components/List/__stories__/Overflow.stories.tsx index a6ee3e1a53..3796729f05 100644 --- a/packages/ui/src/components/List/__stories__/Overflow.stories.tsx +++ b/packages/ui/src/components/List/__stories__/Overflow.stories.tsx @@ -3,22 +3,16 @@ import { List } from '..' import { data, overflowColumns } from './resources' export const Overflow: StoryFn = args => ( - <> - - {data.map(planet => ( - - {planet.id} - {planet.name} - {planet.perihelion}AU - {planet.aphelion}AU - - ))} - - + + {data.map(planet => ( + + {planet.id} + {planet.name} + {planet.perihelion}AU + {planet.aphelion}AU + + ))} + ) Overflow.parameters = { diff --git a/packages/ui/src/components/List/__tests__/index.test.tsx b/packages/ui/src/components/List/__tests__/index.test.tsx index caeece080b..8aebe5ff41 100644 --- a/packages/ui/src/components/List/__tests__/index.test.tsx +++ b/packages/ui/src/components/List/__tests__/index.test.tsx @@ -1,6 +1,6 @@ import { ThemeProvider } from '@emotion/react' import { fireEvent, render, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import type { ComponentProps, Dispatch, ReactNode, SetStateAction } from 'react' import { useState } from 'react' diff --git a/packages/ui/src/components/Menu/__tests__/index.test.tsx b/packages/ui/src/components/Menu/__tests__/index.test.tsx index 1236113043..583be59e74 100644 --- a/packages/ui/src/components/Menu/__tests__/index.test.tsx +++ b/packages/ui/src/components/Menu/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot, diff --git a/packages/ui/src/components/MenuV2/__tests__/index.test.tsx b/packages/ui/src/components/MenuV2/__tests__/index.test.tsx index 753ff2acbf..d11300ba2f 100644 --- a/packages/ui/src/components/MenuV2/__tests__/index.test.tsx +++ b/packages/ui/src/components/MenuV2/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot, diff --git a/packages/ui/src/components/Modal/__tests__/index.test.tsx b/packages/ui/src/components/Modal/__tests__/index.test.tsx index 98c7888585..79e9ed8c3f 100644 --- a/packages/ui/src/components/Modal/__tests__/index.test.tsx +++ b/packages/ui/src/components/Modal/__tests__/index.test.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/react' import { renderHook, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { consoleLightTheme } from '@ultraviolet/themes' import { renderWithTheme, diff --git a/packages/ui/src/components/NumberInput/__tests__/index.test.tsx b/packages/ui/src/components/NumberInput/__tests__/index.test.tsx index 25ff4740f2..5a9ed98b00 100644 --- a/packages/ui/src/components/NumberInput/__tests__/index.test.tsx +++ b/packages/ui/src/components/NumberInput/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { act, fireEvent, screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, it } from 'vitest' import { NumberInput } from '..' diff --git a/packages/ui/src/components/NumberInputV2/__tests__/index.test.tsx b/packages/ui/src/components/NumberInputV2/__tests__/index.test.tsx index f169e589e9..5ee601cebd 100644 --- a/packages/ui/src/components/NumberInputV2/__tests__/index.test.tsx +++ b/packages/ui/src/components/NumberInputV2/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, it, vi } from 'vitest' import { NumberInputV2 } from '..' diff --git a/packages/ui/src/components/Pagination/__tests__/index.test.tsx b/packages/ui/src/components/Pagination/__tests__/index.test.tsx index 8e995c63dc..bb9cb97708 100644 --- a/packages/ui/src/components/Pagination/__tests__/index.test.tsx +++ b/packages/ui/src/components/Pagination/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme } from '@utils/test' import { describe, expect, test } from 'vitest' import { Pagination } from '..' diff --git a/packages/ui/src/components/PieChart/__tests__/index.test.tsx b/packages/ui/src/components/PieChart/__tests__/index.test.tsx index d2945436fc..866631e4b0 100644 --- a/packages/ui/src/components/PieChart/__tests__/index.test.tsx +++ b/packages/ui/src/components/PieChart/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme } from '@utils/test' import { beforeAll, describe, expect, test, vi } from 'vitest' import { PieChart } from '..' diff --git a/packages/ui/src/components/Popover/__tests__/index.test.tsx b/packages/ui/src/components/Popover/__tests__/index.test.tsx index cdfa047c55..c75a22868c 100644 --- a/packages/ui/src/components/Popover/__tests__/index.test.tsx +++ b/packages/ui/src/components/Popover/__tests__/index.test.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled' import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import type { ComponentProps } from 'react' import { useCallback, useState } from 'react' diff --git a/packages/ui/src/components/Popup/__tests__/index.test.tsx b/packages/ui/src/components/Popup/__tests__/index.test.tsx index 25f6e37631..ee5104f859 100644 --- a/packages/ui/src/components/Popup/__tests__/index.test.tsx +++ b/packages/ui/src/components/Popup/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshotWithPortal, diff --git a/packages/ui/src/components/SearchInput/__tests__/index.test.tsx b/packages/ui/src/components/SearchInput/__tests__/index.test.tsx index 17bb186d4d..8804dd1c40 100644 --- a/packages/ui/src/components/SearchInput/__tests__/index.test.tsx +++ b/packages/ui/src/components/SearchInput/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test } from 'vitest' import { SearchInput } from '..' diff --git a/packages/ui/src/components/SelectInput/__tests__/index.test.tsx b/packages/ui/src/components/SelectInput/__tests__/index.test.tsx index 2c7d31d234..dee5118e43 100644 --- a/packages/ui/src/components/SelectInput/__tests__/index.test.tsx +++ b/packages/ui/src/components/SelectInput/__tests__/index.test.tsx @@ -1,6 +1,6 @@ import type { CSSObject } from '@emotion/react' import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot, diff --git a/packages/ui/src/components/SelectInputV2/__tests__/index.test.tsx b/packages/ui/src/components/SelectInputV2/__tests__/index.test.tsx index 052eb5f806..aa9ceb58bf 100644 --- a/packages/ui/src/components/SelectInputV2/__tests__/index.test.tsx +++ b/packages/ui/src/components/SelectInputV2/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme } from '@utils/test' import type { ReactNode } from 'react' import { act } from 'react' diff --git a/packages/ui/src/components/SelectableCard/__tests__/index.test.tsx b/packages/ui/src/components/SelectableCard/__tests__/index.test.tsx index 8858d5c4d4..5e4dedcf84 100644 --- a/packages/ui/src/components/SelectableCard/__tests__/index.test.tsx +++ b/packages/ui/src/components/SelectableCard/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { act, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, test, vi } from 'vitest' import { SelectableCard } from '..' diff --git a/packages/ui/src/components/Slider/__tests__/doubleSlider.test.tsx b/packages/ui/src/components/Slider/__tests__/doubleSlider.test.tsx index baa5cfbee4..73f279d651 100644 --- a/packages/ui/src/components/Slider/__tests__/doubleSlider.test.tsx +++ b/packages/ui/src/components/Slider/__tests__/doubleSlider.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' import { Slider } from '..' diff --git a/packages/ui/src/components/Slider/__tests__/singleSlider.test.tsx b/packages/ui/src/components/Slider/__tests__/singleSlider.test.tsx index 2e0835f772..c1f4431bfb 100644 --- a/packages/ui/src/components/Slider/__tests__/singleSlider.test.tsx +++ b/packages/ui/src/components/Slider/__tests__/singleSlider.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest' import { Slider } from '..' diff --git a/packages/ui/src/components/Snippet/__tests__/index.test.tsx b/packages/ui/src/components/Snippet/__tests__/index.test.tsx index b1ebc33ad3..8e2c243adc 100644 --- a/packages/ui/src/components/Snippet/__tests__/index.test.tsx +++ b/packages/ui/src/components/Snippet/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, it, test } from 'vitest' import { Snippet } from '../index' diff --git a/packages/ui/src/components/Stepper/__tests__/index.test.tsx b/packages/ui/src/components/Stepper/__tests__/index.test.tsx index ab6dfca87a..e5a2f5c8c1 100644 --- a/packages/ui/src/components/Stepper/__tests__/index.test.tsx +++ b/packages/ui/src/components/Stepper/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test } from 'vitest' import { Stepper } from '..' diff --git a/packages/ui/src/components/SwitchButton/__tests__/index.test.tsx b/packages/ui/src/components/SwitchButton/__tests__/index.test.tsx index 27ce2e2a7b..6ba82fa0c9 100644 --- a/packages/ui/src/components/SwitchButton/__tests__/index.test.tsx +++ b/packages/ui/src/components/SwitchButton/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, test, vi } from 'vitest' import { SwitchButton } from '..' diff --git a/packages/ui/src/components/Table/__stories__/Style.stories.tsx b/packages/ui/src/components/Table/__stories__/Style.stories.tsx index 7204fed8b9..734e918fe0 100644 --- a/packages/ui/src/components/Table/__stories__/Style.stories.tsx +++ b/packages/ui/src/components/Table/__stories__/Style.stories.tsx @@ -4,16 +4,16 @@ import { Stack, Text } from '../..' import { columns, data } from './resources' const combos = [ - { stripped: false, bordered: false }, - { stripped: true, bordered: false }, - { stripped: false, bordered: true }, - { stripped: true, bordered: true }, -] + { stripped: false, bordered: false, id: 1 }, + { stripped: true, bordered: false, id: 2 }, + { stripped: false, bordered: true, id: 3 }, + { stripped: true, bordered: true, id: 4 }, +] as const export const Style: StoryFn = args => ( - {combos.map((combo, index) => ( - + {combos.map(combo => ( + {combo.stripped ? '✅' : '❌'} Stripped |{' '} {combo.bordered ? '✅' : '❌'} Bordered diff --git a/packages/ui/src/components/Table/__tests__/index.test.tsx b/packages/ui/src/components/Table/__tests__/index.test.tsx index e1f60a2e4c..033324cd6d 100644 --- a/packages/ui/src/components/Table/__tests__/index.test.tsx +++ b/packages/ui/src/components/Table/__tests__/index.test.tsx @@ -1,6 +1,6 @@ import { ThemeProvider } from '@emotion/react' import { fireEvent, render, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import type { ComponentProps, Dispatch, ReactNode, SetStateAction } from 'react' import { useState } from 'react' diff --git a/packages/ui/src/components/TagInput/__tests__/index.test.tsx b/packages/ui/src/components/TagInput/__tests__/index.test.tsx index 6ca0621c6f..85963a4b0c 100644 --- a/packages/ui/src/components/TagInput/__tests__/index.test.tsx +++ b/packages/ui/src/components/TagInput/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, it, vi } from 'vitest' import { TagInput } from '..' diff --git a/packages/ui/src/components/TagList/__tests__/index.test.tsx b/packages/ui/src/components/TagList/__tests__/index.test.tsx index 9de7708ba3..8c07635a55 100644 --- a/packages/ui/src/components/TagList/__tests__/index.test.tsx +++ b/packages/ui/src/components/TagList/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme } from '@utils/test' import { afterAll, describe, expect, test, vi } from 'vitest' import type { TagType } from '..' diff --git a/packages/ui/src/components/TextArea/__tests__/index.test.tsx b/packages/ui/src/components/TextArea/__tests__/index.test.tsx index c6dd4a52e8..f2d526e721 100644 --- a/packages/ui/src/components/TextArea/__tests__/index.test.tsx +++ b/packages/ui/src/components/TextArea/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { TextArea } from '..' diff --git a/packages/ui/src/components/TextInput/__tests__/index.test.tsx b/packages/ui/src/components/TextInput/__tests__/index.test.tsx index 6455132cc7..4b6fe2c991 100644 --- a/packages/ui/src/components/TextInput/__tests__/index.test.tsx +++ b/packages/ui/src/components/TextInput/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { act, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test } from 'vitest' import { TextInput } from '..' diff --git a/packages/ui/src/components/TextInputV2/__tests__/index.test.tsx b/packages/ui/src/components/TextInputV2/__tests__/index.test.tsx index b4d41dd050..51b673ac2f 100644 --- a/packages/ui/src/components/TextInputV2/__tests__/index.test.tsx +++ b/packages/ui/src/components/TextInputV2/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { fireEvent, screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test, vi } from 'vitest' import { TextInputV2 } from '..' diff --git a/packages/ui/src/components/Toggle/__tests__/index.test.tsx b/packages/ui/src/components/Toggle/__tests__/index.test.tsx index 39cf244ec5..b8766762fd 100644 --- a/packages/ui/src/components/Toggle/__tests__/index.test.tsx +++ b/packages/ui/src/components/Toggle/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test } from 'vitest' import { Toggle } from '..' diff --git a/packages/ui/src/components/Tooltip/__tests__/index.test.tsx b/packages/ui/src/components/Tooltip/__tests__/index.test.tsx index acb3705250..a19329dd26 100644 --- a/packages/ui/src/components/Tooltip/__tests__/index.test.tsx +++ b/packages/ui/src/components/Tooltip/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen, waitFor } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { consoleLightTheme } from '@ultraviolet/themes' import { renderWithTheme } from '@utils/test' import type { ComponentProps } from 'react' diff --git a/packages/ui/src/components/UnitInput/__tests__/index.test.tsx b/packages/ui/src/components/UnitInput/__tests__/index.test.tsx index 1c1446a718..66fd847691 100644 --- a/packages/ui/src/components/UnitInput/__tests__/index.test.tsx +++ b/packages/ui/src/components/UnitInput/__tests__/index.test.tsx @@ -1,5 +1,5 @@ import { screen } from '@testing-library/react' -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test' import { describe, expect, test } from 'vitest' import { UnitInput } from '..' diff --git a/packages/ui/src/components/VerificationCode/index.tsx b/packages/ui/src/components/VerificationCode/index.tsx index f247bc1ec6..07d5792984 100644 --- a/packages/ui/src/components/VerificationCode/index.tsx +++ b/packages/ui/src/components/VerificationCode/index.tsx @@ -300,7 +300,7 @@ export const VerificationCode = ({ inputSize={size} type={type === 'number' ? 'tel' : type} pattern={type === 'number' ? '[0-9]*' : undefined} - key={index} + key={`field-${index}`} data-testid={index} value={value} id={`${inputId || uniqueId}-${index}`} diff --git a/packages/ui/src/emotion.d.ts b/packages/ui/src/emotion.d.ts index b8c871bf9a..fd16571f1d 100644 --- a/packages/ui/src/emotion.d.ts +++ b/packages/ui/src/emotion.d.ts @@ -1,5 +1,6 @@ -import type { UltravioletUITheme } from '.' +import type { consoleLightTheme } from '@ultraviolet/themes' +type UltravioletUITheme = typeof consoleLightTheme declare module '@emotion/react' { export interface Theme extends UltravioletUITheme {} } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db029ae42c..600bf19d2a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -213,8 +213,8 @@ importers: specifier: 9.16.0 version: 9.16.0(jiti@2.1.0) eslint-plugin-oxlint: - specifier: 0.14.1 - version: 0.14.1 + specifier: 0.15.0 + version: 0.15.0 eslint-plugin-testing-library: specifier: 7.1.1 version: 7.1.1(eslint@9.16.0(jiti@2.1.0))(typescript@5.7.2) @@ -246,8 +246,8 @@ importers: specifier: 15.2.11 version: 15.2.11 oxlint: - specifier: 0.13.2 - version: 0.13.2 + specifier: 0.15.0 + version: 0.15.0 postcss: specifier: 8.4.49 version: 8.4.49 @@ -2504,43 +2504,43 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} - '@oxlint/darwin-arm64@0.13.2': - resolution: {integrity: sha512-Jbi2UX1xTFTpH/D6n15RzDSG/44oJ0FwrHWl96TsdD3PAOGxmm8LgcrsCU4d22TSN7ShDFB8y34MYplduRzhfA==} + '@oxlint/darwin-arm64@0.15.0': + resolution: {integrity: sha512-Y4yFRquejyuI/3dyBxLvc8lbwM8Hf/8e0YH9QwQPD9+dgzgOnF818/+OKVE4bDH/V7nWyw4hIQQibMcPvg038g==} cpu: [arm64] os: [darwin] - '@oxlint/darwin-x64@0.13.2': - resolution: {integrity: sha512-ulA2vpNIM14VWJua6BjgX6l8nrjY8Un0uLqBLgELyDHMfpnC0HfrB2mR9PC9tRhb7+BEbgDLWTRs2aTV64eprw==} + '@oxlint/darwin-x64@0.15.0': + resolution: {integrity: sha512-l0NksXD2HSzb/u7RXH1kPNtwOXevkvS4vH7pMDiSrfIbtZTx10YgiLy5zFkFbipJRLmIZUdG+9JEjepsy9S3Ig==} cpu: [x64] os: [darwin] - '@oxlint/linux-arm64-gnu@0.13.2': - resolution: {integrity: sha512-iwguvPnIx/yIMc2IrwLeRflEFwyn+gcsNR8le5aX5DvQfHiB3/3x5JxOVl7Nd93lLsOg8RyVr2E11CxV10rKWw==} + '@oxlint/linux-arm64-gnu@0.15.0': + resolution: {integrity: sha512-Yt2LGRfMwPXrMelEqbbkWFcL50ulAUUqMrfcNYB+H/9S8KF4PSMDRm642VV4949xC3XzkjoL3ZMyKQQKMRWC+Q==} cpu: [arm64] os: [linux] - '@oxlint/linux-arm64-musl@0.13.2': - resolution: {integrity: sha512-YJVvVyuvUobgCmiE47kBwN6dymLcQBG5/NsEaCbVyYw5HQJN7Ywp/x4suaF4c6M9ItPCnLxEZ4Lwu5TkrkU3vQ==} + '@oxlint/linux-arm64-musl@0.15.0': + resolution: {integrity: sha512-+H6CIbejZyE3sc3StoYImqZL3z2zNbv5L547ATLHGyQ5b2JrXMuJ/lqIaNdAa24BehJ6g+/swBIIE5Pk65K3PA==} cpu: [arm64] os: [linux] - '@oxlint/linux-x64-gnu@0.13.2': - resolution: {integrity: sha512-w78gjd3ZJ+ahByS5gmN0jxFn/+G3W/oBJbyGFOuteXYcJwLj6JIyS0VhpMKxuAdFNCnsjJeDHSbdWaCV6VkA3A==} + '@oxlint/linux-x64-gnu@0.15.0': + resolution: {integrity: sha512-e/KSj4fg5EFdK/bJLJjGRzaw2KZdYgr2mTt3k9HF9YIGl0UnBoX5h+q0hJ9scDTNNailT8qytvOjuiUhyJpAPA==} cpu: [x64] os: [linux] - '@oxlint/linux-x64-musl@0.13.2': - resolution: {integrity: sha512-yedk6KQT3jtBzpzExo3Ib7NwfuugaaFKvk/EzXEojMQ5aYh6CNhmVmm+adzwBp4YyOeXQZxSPHQ1LcNwDCUJIA==} + '@oxlint/linux-x64-musl@0.15.0': + resolution: {integrity: sha512-lOXNTYw7kelNkJPQlrLlk5E8f/ROZFcGOGR5VKHCI+/53QTX/WY5kMo7JOaRyJ+jnNdeN1HW70oRQPjtAujjxw==} cpu: [x64] os: [linux] - '@oxlint/win32-arm64@0.13.2': - resolution: {integrity: sha512-KZvJ3uMWSCwkZtvOcO+K4mLmYU/jIcHUb00s8aPasG1taflbjINsq9ZUUj5LNigcDwJRZGUwNcvY5KuQ+E9WtQ==} + '@oxlint/win32-arm64@0.15.0': + resolution: {integrity: sha512-Hms4Ld6uAOKpbLq27MUqQzffxd71+pK96mzK3YULrkASzIa7AZdtNlRBqfqVRuXCiuxPxT6PhfcriURwsvD/YA==} cpu: [arm64] os: [win32] - '@oxlint/win32-x64@0.13.2': - resolution: {integrity: sha512-G8FM8RTJRMt2dPRJ/TXhqIEu9k00vRAoh3DSV2r3o+jD8FZDBZXOgoDn2D0F9HqgFLEOVTxpfalmWntyk2hmyw==} + '@oxlint/win32-x64@0.15.0': + resolution: {integrity: sha512-AF0t15GJLoVcMqvbpHwYFHx2o9HkMuEt6GEipPMZ9gaNx1yp6NrP655jywNzhbKHSd6wxSY+CH7aRI9QjdtG1w==} cpu: [x64] os: [win32] @@ -4627,8 +4627,8 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 - eslint-plugin-oxlint@0.14.1: - resolution: {integrity: sha512-P1IrDS3sRl/2AJwvwJmW1EnsF0AIzUHii8haSkWj8xm5+BW/Gux8S+SXu8uqgJoKkzvV+X7lDxPm4ao4C+COBw==} + eslint-plugin-oxlint@0.15.0: + resolution: {integrity: sha512-W2bJu+w9jYPb3x9MQleJuF1iUSIHWLCR0ChknPgSuz8ZjQgrNlSt5SBYl9FtdOZ09wFzU/CvvIYs86EhhexrdA==} eslint-plugin-react-hooks@5.0.0: resolution: {integrity: sha512-hIOwI+5hYGpJEc4uPRmz2ulCjAGD/N13Lukkh8cLV0i2IRk/bdZDYjgLVHj+U9Z704kLIdIO6iueGvxNur0sgw==} @@ -6143,8 +6143,8 @@ packages: outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} - oxlint@0.13.2: - resolution: {integrity: sha512-R7wXUspM75TeEXaAFLmuPH0W3h5B5r6BNtOvkcnVddD3BWbBiEOWe9bCqt4+te0l8wQ4a0/XLCGrJroxFFeajg==} + oxlint@0.15.0: + resolution: {integrity: sha512-hIED9mcs8c0dnNuQEzXRPXOo09HoOVh60LSD48EQHwcHlcFheMfW5OkLWQvinDkG/1n5qt+zWopQGaKFgmtXPw==} engines: {node: '>=14.*'} hasBin: true @@ -10134,28 +10134,28 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@oxlint/darwin-arm64@0.13.2': + '@oxlint/darwin-arm64@0.15.0': optional: true - '@oxlint/darwin-x64@0.13.2': + '@oxlint/darwin-x64@0.15.0': optional: true - '@oxlint/linux-arm64-gnu@0.13.2': + '@oxlint/linux-arm64-gnu@0.15.0': optional: true - '@oxlint/linux-arm64-musl@0.13.2': + '@oxlint/linux-arm64-musl@0.15.0': optional: true - '@oxlint/linux-x64-gnu@0.13.2': + '@oxlint/linux-x64-gnu@0.15.0': optional: true - '@oxlint/linux-x64-musl@0.13.2': + '@oxlint/linux-x64-musl@0.15.0': optional: true - '@oxlint/win32-arm64@0.13.2': + '@oxlint/win32-arm64@0.15.0': optional: true - '@oxlint/win32-x64@0.13.2': + '@oxlint/win32-x64@0.15.0': optional: true '@pkgjs/parseargs@0.11.0': @@ -12700,7 +12700,7 @@ snapshots: safe-regex-test: 1.0.3 string.prototype.includes: 2.0.1 - eslint-plugin-oxlint@0.14.1: + eslint-plugin-oxlint@0.15.0: dependencies: jsonc-parser: 3.3.1 @@ -14477,16 +14477,16 @@ snapshots: outdent@0.5.0: {} - oxlint@0.13.2: + oxlint@0.15.0: optionalDependencies: - '@oxlint/darwin-arm64': 0.13.2 - '@oxlint/darwin-x64': 0.13.2 - '@oxlint/linux-arm64-gnu': 0.13.2 - '@oxlint/linux-arm64-musl': 0.13.2 - '@oxlint/linux-x64-gnu': 0.13.2 - '@oxlint/linux-x64-musl': 0.13.2 - '@oxlint/win32-arm64': 0.13.2 - '@oxlint/win32-x64': 0.13.2 + '@oxlint/darwin-arm64': 0.15.0 + '@oxlint/darwin-x64': 0.15.0 + '@oxlint/linux-arm64-gnu': 0.15.0 + '@oxlint/linux-arm64-musl': 0.15.0 + '@oxlint/linux-x64-gnu': 0.15.0 + '@oxlint/linux-x64-musl': 0.15.0 + '@oxlint/win32-arm64': 0.15.0 + '@oxlint/win32-x64': 0.15.0 p-filter@2.1.0: dependencies: diff --git a/scripts/figma-synchronise-tokens.mjs b/scripts/figma-synchronise-tokens.mjs index b3f3f81fbd..017cd16b38 100755 --- a/scripts/figma-synchronise-tokens.mjs +++ b/scripts/figma-synchronise-tokens.mjs @@ -35,8 +35,11 @@ function alphaOrder(obj) { const orderedKeys = Object.keys(obj ?? {}).sort() return orderedKeys.reduce((newObj, key) => { + const result = + typeof obj[key] === 'object' ? alphaOrder(obj[key]) : obj[key] + // eslint-disable-next-line no-param-reassign - newObj[key] = typeof obj[key] === 'object' ? alphaOrder(obj[key]) : obj[key] + newObj[key] = result return newObj }, {}) diff --git a/utils/test/src/vitest/mockFormErrors.ts b/utils/test/src/vitest/mockFormErrors.ts index 578782d673..ec2a9266e2 100644 --- a/utils/test/src/vitest/mockFormErrors.ts +++ b/utils/test/src/vitest/mockFormErrors.ts @@ -20,4 +20,15 @@ export const mockFormErrors: FormErrors = { `This field should be before ${maxDate?.toString() ?? ''}`, minDate: ({ minDate }) => `This field should be after ${minDate?.toString() ?? ''}`, + isInteger: ({ isInteger }) => { + if (typeof isInteger === 'number') { + if (Number.isInteger(isInteger)) { + return 'This field should be a decimal number' + } + + return 'This field should be a whole number' + } + + return 'This field should be a number' + }, } diff --git a/utils/test/src/vitest/mockMatchMedia.ts b/utils/test/src/vitest/mockMatchMedia.ts index 6533aa5ced..8f3f980b72 100644 --- a/utils/test/src/vitest/mockMatchMedia.ts +++ b/utils/test/src/vitest/mockMatchMedia.ts @@ -26,5 +26,5 @@ function getMockImplementation({ media, matches = false }: MockMatchMedia) { export const mockMatchMedia = ({ media, matches = false }: MockMatchMedia) => { const mockedImplementation = getMockImplementation({ media, matches }) - window.matchMedia = vi.fn().mockImplementation(mockedImplementation) + vi.spyOn(window, 'matchMedia').mockImplementation(mockedImplementation) } diff --git a/utils/test/src/vitest/resetUserEvent.tsx b/utils/test/src/vitest/resetUserEvent.tsx index e73b48bf5d..69f50592d6 100644 --- a/utils/test/src/vitest/resetUserEvent.tsx +++ b/utils/test/src/vitest/resetUserEvent.tsx @@ -1,6 +1,6 @@ /* eslint-disable eslint-comments/disable-enable-pair */ -import userEvent from '@testing-library/user-event' +import { userEvent } from '@testing-library/user-event' export const resetUserEvent = (element: HTMLInputElement) => userEvent.type(element, '{backspace}', { diff --git a/utils/test/src/vitest/setup.ts b/utils/test/src/vitest/setup.ts index 64622aca82..d6483766c0 100644 --- a/utils/test/src/vitest/setup.ts +++ b/utils/test/src/vitest/setup.ts @@ -19,11 +19,13 @@ export const setup = () => { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument expect.addSnapshotSerializer(createSerializer()) + // oxlint-disable-next-line no-hooks beforeEach(() => { setupIntersectionMocking(vi.fn()) vi.spyOn(global.Math, 'random').mockReturnValue(0.4155913669444804) }) + // oxlint-disable-next-line no-hooks afterEach(() => { resetIntersectionMocking() vi.spyOn(global.Math, 'random').mockRestore()