diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8e6718a3..ef6d6b6c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,8 @@ jobs: - name: Lint run: yarn lint - - name: Prettier - run: yarn prettier + - name: Format + run: yarn format:check typecheck: runs-on: ubuntu-latest diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 000000000..dcdc60d7f --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,15 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "singleQuote": true, + "trailingComma": "all", + "printWidth": 100, + "sortImports": { + "groups": [ + "side_effect", + ["builtin", "external", "internal", "subpath", "unknown"], + ["parent", "sibling", "index"] + ] + }, + "sortPackageJson": false, + "ignorePatterns": ["node_modules/", ".yarn", "codemods/**/tests/fixtures/**"] +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index f0073a419..000000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -.yarn -codemods/**/tests/fixtures/** diff --git a/AGENTS.md b/AGENTS.md index 6d402322e..0c0e938b6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ - `yarn test:ci` - `yarn typecheck` - `yarn lint` - - `yarn prettier` + - `yarn format:check` - `yarn build` - `yarn validate` - Task-specific guidance: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b8aba420..9033c236d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,10 +32,10 @@ Our pre-commit hooks verify that your commit message matches this format when co ### Linting and tests -We use TypeScript for type checking, `eslint` with `prettier` for linting and formatting the code, and `jest` for testing. Our pre-commit hooks verify that the linter and tests pass when committing. You can also run the following commands manually: +We use TypeScript for type checking, `eslint` and `oxfmt` for linting and formatting the code, and `jest` for testing. Our pre-commit hooks verify that the linter and tests pass when committing. You can also run the following commands manually: - `yarn typecheck`: run TypeScript compiler on all files. -- `yarn lint`: run eslint and prettier. +- `yarn lint`: run eslint. - `yarn test`: run tests. ### Sending a pull request diff --git a/agents/build-and-validation.md b/agents/build-and-validation.md index 19cfc8cff..675036dc8 100644 --- a/agents/build-and-validation.md +++ b/agents/build-and-validation.md @@ -7,14 +7,14 @@ - Run tests in CI mode: `yarn test:ci` - Type check: `yarn typecheck` - Lint source files: `yarn lint` -- Check formatting: `yarn prettier` +- Check formatting: `yarn format:check` - Validate the main package: `yarn validate` - Build the package: `yarn build` ## Command notes - `yarn lint` runs ESLint on `src`. -- `yarn validate` runs typecheck, tests, lint, and Prettier checks for the main package. +- `yarn validate` runs typecheck, tests, lint, and oxfmt checks for the main package. - `yarn build` cleans `dist/`, transpiles source with Babel, and emits TypeScript declarations. ## Repo layout diff --git a/agents/code-style.md b/agents/code-style.md index d1ebe53e5..fd56b1fcf 100644 --- a/agents/code-style.md +++ b/agents/code-style.md @@ -4,9 +4,9 @@ - ESLint uses `@callstack/eslint-config` together with `typescript-eslint`. - Important enforced rules include `no-console` and consistent type imports. -- Prettier is the formatter. +- oxfmt is the formatter. - Formatting defaults include single quotes and trailing commas. ## Imports -- Keep imports sorted with `eslint-plugin-simple-import-sort`. +- Keep imports sorted with `oxfmt`. diff --git a/codemods/v14-async-functions/scripts/codemod.ts b/codemods/v14-async-functions/scripts/codemod.ts index 49fdb7891..93e034d59 100644 --- a/codemods/v14-async-functions/scripts/codemod.ts +++ b/codemods/v14-async-functions/scripts/codemod.ts @@ -1,6 +1,6 @@ +import type { Edit, SgNode } from '@codemod.com/jssg-types/main'; import type { Transform } from 'codemod:ast-grep'; import type TSX from 'codemod:ast-grep/langs/tsx'; -import type { Edit, SgNode } from '@codemod.com/jssg-types/main'; const FUNCTIONS_TO_MAKE_ASYNC = new Set(['render', 'renderHook', 'act', 'fireEvent']); const FIRE_EVENT_METHODS_TO_MAKE_ASYNC = new Set(['press', 'changeText', 'scroll']); @@ -241,10 +241,16 @@ function extractImportedFunctionNames( edits: Edit[], ): { importedFunctions: Set; - specifiersToRemove: Array<{ specifier: SgNode; importStmt: SgNode }>; + specifiersToRemove: Array<{ + specifier: SgNode; + importStmt: SgNode; + }>; } { const importedFunctions = new Set(); - const specifiersToRemove: Array<{ specifier: SgNode; importStmt: SgNode }> = []; + const specifiersToRemove: Array<{ + specifier: SgNode; + importStmt: SgNode; + }> = []; for (const importStmt of rntlImports) { const importClause = importStmt.find({ @@ -332,7 +338,10 @@ function extractImportedFunctionNames( * @param edits - Array to collect edit operations */ function removeDuplicateImportSpecifiers( - specifiersToRemove: Array<{ specifier: SgNode; importStmt: SgNode }>, + specifiersToRemove: Array<{ + specifier: SgNode; + importStmt: SgNode; + }>, rootNode: SgNode, edits: Edit[], ): void { @@ -464,11 +473,17 @@ function findFireEventMethodCalls( for (const [asyncName, syncName] of ASYNC_FUNCTIONS_TO_RENAME.entries()) { if (syncName === 'fireEvent') { const wasImported = rntlImports.some((importStmt) => { - const importClause = importStmt.find({ rule: { kind: 'import_clause' } }); + const importClause = importStmt.find({ + rule: { kind: 'import_clause' }, + }); if (!importClause) return false; - const namedImports = importClause.find({ rule: { kind: 'named_imports' } }); + const namedImports = importClause.find({ + rule: { kind: 'named_imports' }, + }); if (!namedImports) return false; - const specifiers = namedImports.findAll({ rule: { kind: 'import_specifier' } }); + const specifiers = namedImports.findAll({ + rule: { kind: 'import_specifier' }, + }); return specifiers.some((spec) => { const identifier = spec.find({ rule: { kind: 'identifier' } }); return identifier && identifier.text() === asyncName; diff --git a/docs/api/queries.md b/docs/api/queries.md index 724955d6a..000732e73 100644 --- a/docs/api/queries.md +++ b/docs/api/queries.md @@ -400,7 +400,9 @@ expect( // Include hidden elements expect( - screen.getByText('Hidden from accessibility', { includeHiddenElements: true }), + screen.getByText('Hidden from accessibility', { + includeHiddenElements: true, + }), ).toBeOnTheScreen(); ``` diff --git a/docs/api/screen.md b/docs/api/screen.md index 4dfff395b..64af3da5e 100644 --- a/docs/api/screen.md +++ b/docs/api/screen.md @@ -121,7 +121,10 @@ You can also transform prop values so that they are more readable (e.g., flatten import { StyleSheet } from 'react-native'; screen.debug({ - mapProps: ({ style, ...props }) => ({ style: StyleSheet.flatten(style), ...props }), + mapProps: ({ style, ...props }) => ({ + style: StyleSheet.flatten(style), + ...props, + }), }); ``` diff --git a/eslint.config.mjs b/eslint.config.mjs index ff216e85e..160322fa5 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,8 +1,7 @@ -import tseslint from 'typescript-eslint'; import callstackConfig from '@callstack/eslint-config/react-native.flat.js'; import { fixupPluginRules } from '@eslint/compat'; import pluginJest from 'eslint-plugin-jest'; -import simpleImportSort from 'eslint-plugin-simple-import-sort'; +import tseslint from 'typescript-eslint'; const additionalTestBlockFunctions = ['testGateReact19_2']; @@ -26,23 +25,11 @@ export default [ }, ...patchedCallstackConfig, ...tseslint.configs.strict, - { - plugins: { - 'simple-import-sort': simpleImportSort, - }, - rules: { - 'simple-import-sort/imports': [ - 'error', - { - groups: [['^\\u0000', '^react', '^@?\\w', '^'], ['^\\.']], - }, - ], - }, - }, { rules: { 'no-console': 'error', 'import/order': 'off', + 'prettier/prettier': 'off', '@typescript-eslint/consistent-type-imports': 'error', }, }, diff --git a/examples/basic/App.tsx b/examples/basic/App.tsx index 0d1896383..d0b76ffbe 100644 --- a/examples/basic/App.tsx +++ b/examples/basic/App.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; -import { LoginForm } from './components/LoginForm'; + import { Home } from './components/Home'; +import { LoginForm } from './components/LoginForm'; const App = () => { const [user, setUser] = React.useState(null); diff --git a/examples/basic/__tests__/App.test.tsx b/examples/basic/__tests__/App.test.tsx index fabe47413..f89e82bc9 100644 --- a/examples/basic/__tests__/App.test.tsx +++ b/examples/basic/__tests__/App.test.tsx @@ -1,5 +1,6 @@ -import * as React from 'react'; import { render, screen, userEvent } from '@testing-library/react-native'; +import * as React from 'react'; + import App from '../App'; jest.useFakeTimers(); diff --git a/examples/basic/components/LoginForm.tsx b/examples/basic/components/LoginForm.tsx index fdea5c2d0..8cbe75ba8 100644 --- a/examples/basic/components/LoginForm.tsx +++ b/examples/basic/components/LoginForm.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { StyleSheet, View, Text, TextInput, Pressable, ActivityIndicator } from 'react-native'; + import { theme } from '../theme'; type Props = { diff --git a/examples/basic/components/__tests__/AnimatedView.test.tsx b/examples/basic/components/__tests__/AnimatedView.test.tsx index 168a57ecd..b42d4a9b8 100644 --- a/examples/basic/components/__tests__/AnimatedView.test.tsx +++ b/examples/basic/components/__tests__/AnimatedView.test.tsx @@ -1,6 +1,7 @@ +import { act, render, screen } from '@testing-library/react-native'; import * as React from 'react'; import { Text } from 'react-native'; -import { act, render, screen } from '@testing-library/react-native'; + import { AnimatedView } from '../AnimatedView'; describe('AnimatedView', () => { diff --git a/examples/cookbook/app/_layout.tsx b/examples/cookbook/app/_layout.tsx index 6ec488c2b..114293b9f 100644 --- a/examples/cookbook/app/_layout.tsx +++ b/examples/cookbook/app/_layout.tsx @@ -1,5 +1,6 @@ -import * as React from 'react'; import { Stack } from 'expo-router'; +import * as React from 'react'; + import theme from '../theme'; export default function RootLayout() { diff --git a/examples/cookbook/app/custom-render/WelcomeScreen.tsx b/examples/cookbook/app/custom-render/WelcomeScreen.tsx index c38111d14..4e3d08a0d 100644 --- a/examples/cookbook/app/custom-render/WelcomeScreen.tsx +++ b/examples/cookbook/app/custom-render/WelcomeScreen.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import { StyleSheet, Text, View } from 'react-native'; -import { useUser } from './providers/user-provider'; + import { useTheme } from './providers/theme-provider'; +import { useUser } from './providers/user-provider'; export default function WelcomeScreen() { const theme = useTheme(); diff --git a/examples/cookbook/app/custom-render/__tests__/index.test.tsx b/examples/cookbook/app/custom-render/__tests__/index.test.tsx index 18eec31af..b838458e6 100644 --- a/examples/cookbook/app/custom-render/__tests__/index.test.tsx +++ b/examples/cookbook/app/custom-render/__tests__/index.test.tsx @@ -1,5 +1,6 @@ -import * as React from 'react'; import { screen } from '@testing-library/react-native'; +import * as React from 'react'; + import WelcomeScreen from '../WelcomeScreen'; import { renderWithProviders } from './test-utils'; diff --git a/examples/cookbook/app/custom-render/__tests__/test-utils.tsx b/examples/cookbook/app/custom-render/__tests__/test-utils.tsx index 1d478e7e8..535572949 100644 --- a/examples/cookbook/app/custom-render/__tests__/test-utils.tsx +++ b/examples/cookbook/app/custom-render/__tests__/test-utils.tsx @@ -1,7 +1,8 @@ -import * as React from 'react'; import { render } from '@testing-library/react-native'; -import { User, UserProvider } from '../../../app/custom-render/providers/user-provider'; +import * as React from 'react'; + import { Theme, ThemeProvider } from '../../../app/custom-render/providers/theme-provider'; +import { User, UserProvider } from '../../../app/custom-render/providers/user-provider'; interface RenderWithProvidersProps { user?: User | null; diff --git a/examples/cookbook/app/custom-render/index.tsx b/examples/cookbook/app/custom-render/index.tsx index 470405467..8f9e3c6cb 100644 --- a/examples/cookbook/app/custom-render/index.tsx +++ b/examples/cookbook/app/custom-render/index.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; -import { UserProvider } from './providers/user-provider'; + import { ThemeProvider } from './providers/theme-provider'; +import { UserProvider } from './providers/user-provider'; import WelcomeScreen from './WelcomeScreen'; export default function Example() { diff --git a/examples/cookbook/app/index.tsx b/examples/cookbook/app/index.tsx index 441157eec..26aa26261 100644 --- a/examples/cookbook/app/index.tsx +++ b/examples/cookbook/app/index.tsx @@ -1,6 +1,7 @@ +import { useRouter } from 'expo-router'; import React from 'react'; import { FlatList, Image, Pressable, StyleSheet, Text, View } from 'react-native'; -import { useRouter } from 'expo-router'; + import theme from '../theme'; // React Native static assets are resolved via require(). @@ -86,5 +87,9 @@ type Recipe = { const recipes: Recipe[] = [ { id: 1, title: 'Welcome Screen with Custom Render', path: 'custom-render/' }, { id: 2, title: 'Task List with Jotai', path: 'state-management/jotai/' }, - { id: 3, title: 'Phone book with\na Variety of Net. Req. Methods', path: 'network-requests/' }, + { + id: 3, + title: 'Phone book with\na Variety of Net. Req. Methods', + path: 'network-requests/', + }, ]; diff --git a/examples/cookbook/app/network-requests/PhoneBook.tsx b/examples/cookbook/app/network-requests/PhoneBook.tsx index fe25520da..b1c164035 100644 --- a/examples/cookbook/app/network-requests/PhoneBook.tsx +++ b/examples/cookbook/app/network-requests/PhoneBook.tsx @@ -1,10 +1,11 @@ import React, { useEffect, useState } from 'react'; import { Text } from 'react-native'; -import { User } from './types'; -import ContactsList from './components/ContactsList'; -import FavoritesList from './components/FavoritesList'; + import getAllContacts from './api/getAllContacts'; import getAllFavorites from './api/getAllFavorites'; +import ContactsList from './components/ContactsList'; +import FavoritesList from './components/FavoritesList'; +import { User } from './types'; export default () => { const [usersData, setUsersData] = useState([]); diff --git a/examples/cookbook/app/network-requests/__tests__/PhoneBook.test.tsx b/examples/cookbook/app/network-requests/__tests__/PhoneBook.test.tsx index 4b7017e3f..fb22d0e96 100644 --- a/examples/cookbook/app/network-requests/__tests__/PhoneBook.test.tsx +++ b/examples/cookbook/app/network-requests/__tests__/PhoneBook.test.tsx @@ -1,5 +1,6 @@ import { render, screen } from '@testing-library/react-native'; import React from 'react'; + import PhoneBook from '../PhoneBook'; import { mockServerFailureForGetAllContacts, diff --git a/examples/cookbook/app/network-requests/__tests__/test-utils.ts b/examples/cookbook/app/network-requests/__tests__/test-utils.ts index 44deef49e..13d4eac0d 100644 --- a/examples/cookbook/app/network-requests/__tests__/test-utils.ts +++ b/examples/cookbook/app/network-requests/__tests__/test-utils.ts @@ -1,7 +1,8 @@ -import { User } from '../types'; import { http, HttpResponse } from 'msw'; import { setupServer } from 'msw/node'; +import { User } from '../types'; + // Define request handlers and response resolvers for random user API. // By default, we always return the happy path response. const handlers = [ diff --git a/examples/cookbook/app/network-requests/components/ContactsList.tsx b/examples/cookbook/app/network-requests/components/ContactsList.tsx index f62f99f00..e48c6d6eb 100644 --- a/examples/cookbook/app/network-requests/components/ContactsList.tsx +++ b/examples/cookbook/app/network-requests/components/ContactsList.tsx @@ -1,6 +1,7 @@ -import { FlatList, Image, StyleSheet, Text, View } from 'react-native'; -import React, { useCallback } from 'react'; import type { ListRenderItem } from '@react-native/virtualized-lists'; +import React, { useCallback } from 'react'; +import { FlatList, Image, StyleSheet, Text, View } from 'react-native'; + import { User } from '../types'; export default ({ users }: { users: User[] }) => { diff --git a/examples/cookbook/app/network-requests/components/FavoritesList.tsx b/examples/cookbook/app/network-requests/components/FavoritesList.tsx index c0caad5e4..0cd68d8e2 100644 --- a/examples/cookbook/app/network-requests/components/FavoritesList.tsx +++ b/examples/cookbook/app/network-requests/components/FavoritesList.tsx @@ -1,6 +1,7 @@ -import { FlatList, Image, StyleSheet, Text, View } from 'react-native'; -import React, { useCallback } from 'react'; import type { ListRenderItem } from '@react-native/virtualized-lists'; +import React, { useCallback } from 'react'; +import { FlatList, Image, StyleSheet, Text, View } from 'react-native'; + import { User } from '../types'; export default ({ users }: { users: User[] }) => { @@ -55,5 +56,9 @@ const styles = StyleSheet.create({ borderColor: '#9b6dff', borderWidth: 2, }, - loaderContainer: { height: 52, justifyContent: 'center', alignItems: 'center' }, + loaderContainer: { + height: 52, + justifyContent: 'center', + alignItems: 'center', + }, }); diff --git a/examples/cookbook/app/network-requests/index.tsx b/examples/cookbook/app/network-requests/index.tsx index 86075de32..a2edd2996 100644 --- a/examples/cookbook/app/network-requests/index.tsx +++ b/examples/cookbook/app/network-requests/index.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import PhoneBook from './PhoneBook'; export default function Example() { diff --git a/examples/cookbook/app/state-management/jotai/TaskList.tsx b/examples/cookbook/app/state-management/jotai/TaskList.tsx index 0d6a05f96..b1b765eef 100644 --- a/examples/cookbook/app/state-management/jotai/TaskList.tsx +++ b/examples/cookbook/app/state-management/jotai/TaskList.tsx @@ -1,8 +1,10 @@ import 'react-native-get-random-values'; + +import { useAtom } from 'jotai'; import { nanoid } from 'nanoid'; import * as React from 'react'; import { Pressable, StyleSheet, Text, TextInput, View } from 'react-native'; -import { useAtom } from 'jotai'; + import { newTaskTitleAtom, tasksAtom } from './state'; export function TaskList() { diff --git a/examples/cookbook/app/state-management/jotai/__tests__/TaskList.test.tsx b/examples/cookbook/app/state-management/jotai/__tests__/TaskList.test.tsx index 4457b85e1..782562c5b 100644 --- a/examples/cookbook/app/state-management/jotai/__tests__/TaskList.test.tsx +++ b/examples/cookbook/app/state-management/jotai/__tests__/TaskList.test.tsx @@ -1,8 +1,9 @@ -import * as React from 'react'; import { render, screen, userEvent } from '@testing-library/react-native'; +import * as React from 'react'; + +import { addTask, getAllTasks, newTaskTitleAtom, store, tasksAtom } from '../state'; import { TaskList } from '../TaskList'; import { Task } from '../types'; -import { addTask, getAllTasks, newTaskTitleAtom, store, tasksAtom } from '../state'; import { renderWithAtoms } from './test-utils'; jest.useFakeTimers(); diff --git a/examples/cookbook/app/state-management/jotai/__tests__/test-utils.tsx b/examples/cookbook/app/state-management/jotai/__tests__/test-utils.tsx index 784335301..4f7e762da 100644 --- a/examples/cookbook/app/state-management/jotai/__tests__/test-utils.tsx +++ b/examples/cookbook/app/state-management/jotai/__tests__/test-utils.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; import { render } from '@testing-library/react-native'; import { useHydrateAtoms } from 'jotai/utils'; import type { WritableAtom } from 'jotai/vanilla'; import { PrimitiveAtom } from 'jotai/vanilla/atom'; +import * as React from 'react'; // Jotai models hydrated atom values as variadic writable-atom tuples. // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/examples/cookbook/app/state-management/jotai/index.tsx b/examples/cookbook/app/state-management/jotai/index.tsx index 03920d63f..c5dc45f24 100644 --- a/examples/cookbook/app/state-management/jotai/index.tsx +++ b/examples/cookbook/app/state-management/jotai/index.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; + import { TaskList } from './TaskList'; export default function Example() { diff --git a/examples/cookbook/app/state-management/jotai/state.ts b/examples/cookbook/app/state-management/jotai/state.ts index c5812b33b..1973cefce 100644 --- a/examples/cookbook/app/state-management/jotai/state.ts +++ b/examples/cookbook/app/state-management/jotai/state.ts @@ -1,4 +1,5 @@ import { atom, createStore } from 'jotai'; + import { Task } from './types'; export const tasksAtom = atom([]); diff --git a/examples/cookbook/basics-tutorial-react-strict-dom/1-basics-rsd.test.tsx b/examples/cookbook/basics-tutorial-react-strict-dom/1-basics-rsd.test.tsx index 653a9feee..a752e38f2 100644 --- a/examples/cookbook/basics-tutorial-react-strict-dom/1-basics-rsd.test.tsx +++ b/examples/cookbook/basics-tutorial-react-strict-dom/1-basics-rsd.test.tsx @@ -1,6 +1,6 @@ +import { render, screen } from '@testing-library/react-native'; import * as React from 'react'; import { html } from 'react-strict-dom'; -import { render, screen } from '@testing-library/react-native'; function Greeting({ name = 'World' }) { return ( diff --git a/examples/cookbook/basics-tutorial-react-strict-dom/2.1-query-variants-rsd.test.tsx b/examples/cookbook/basics-tutorial-react-strict-dom/2.1-query-variants-rsd.test.tsx index 79e3eea11..f0f0fe201 100644 --- a/examples/cookbook/basics-tutorial-react-strict-dom/2.1-query-variants-rsd.test.tsx +++ b/examples/cookbook/basics-tutorial-react-strict-dom/2.1-query-variants-rsd.test.tsx @@ -1,6 +1,6 @@ +import { render, screen } from '@testing-library/react-native'; import * as React from 'react'; import { html } from 'react-strict-dom'; -import { render, screen } from '@testing-library/react-native'; test('showcase query variants', async () => { await render( diff --git a/examples/cookbook/basics-tutorial-react-strict-dom/2.2-query-predicates-rsd.test.tsx b/examples/cookbook/basics-tutorial-react-strict-dom/2.2-query-predicates-rsd.test.tsx index 3ec137596..76ef98a85 100644 --- a/examples/cookbook/basics-tutorial-react-strict-dom/2.2-query-predicates-rsd.test.tsx +++ b/examples/cookbook/basics-tutorial-react-strict-dom/2.2-query-predicates-rsd.test.tsx @@ -1,6 +1,6 @@ +import { render, screen } from '@testing-library/react-native'; import * as React from 'react'; import { html } from 'react-strict-dom'; -import { render, screen } from '@testing-library/react-native'; test('query by semantic role: *ByRole (highly recommended)', async () => { await render( diff --git a/examples/cookbook/basics-tutorial-react-strict-dom/3-jest-matchers-rsd.test.tsx b/examples/cookbook/basics-tutorial-react-strict-dom/3-jest-matchers-rsd.test.tsx index 57daf00f1..4ea4d1b7a 100644 --- a/examples/cookbook/basics-tutorial-react-strict-dom/3-jest-matchers-rsd.test.tsx +++ b/examples/cookbook/basics-tutorial-react-strict-dom/3-jest-matchers-rsd.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import { render, screen } from '@testing-library/react-native'; +import * as React from 'react'; import { html, css } from 'react-strict-dom'; test('showcase: toBeOnTheScreen', async () => { @@ -22,7 +22,9 @@ test('showcase: toHaveTextContent', async () => { expect(screen.getByTestId('text')).toHaveTextContent('Hello World'); expect(screen.getByTestId('text')).toHaveTextContent(/hello/i); - expect(screen.getByTestId('text')).toHaveTextContent('Hello', { exact: false }); + expect(screen.getByTestId('text')).toHaveTextContent('Hello', { + exact: false, + }); }); test('showcase: toContainElement', async () => { @@ -78,7 +80,11 @@ test('showcase: toHaveAccessibilityValue', async () => { expect(screen.getByTestId('view')).toHaveAccessibilityValue({ text: '33%' }); expect(screen.getByTestId('view')).toHaveAccessibilityValue({ now: 33 }); - expect(screen.getByTestId('view')).toHaveAccessibilityValue({ now: 33, min: 0, max: 100 }); + expect(screen.getByTestId('view')).toHaveAccessibilityValue({ + now: 33, + min: 0, + max: 100, + }); }); test('showcase: toBeEnabled/toBeDisabled', async () => { diff --git a/examples/cookbook/basics-tutorial-react-strict-dom/4-events-rsd.test.tsx b/examples/cookbook/basics-tutorial-react-strict-dom/4-events-rsd.test.tsx index 88cd0f16e..5a5e58220 100644 --- a/examples/cookbook/basics-tutorial-react-strict-dom/4-events-rsd.test.tsx +++ b/examples/cookbook/basics-tutorial-react-strict-dom/4-events-rsd.test.tsx @@ -19,9 +19,9 @@ * HTML-like components that work across React Native and web platforms. */ +import { render, screen, userEvent } from '@testing-library/react-native'; import * as React from 'react'; import { html } from 'react-strict-dom'; -import { render, screen, userEvent } from '@testing-library/react-native'; /** * ======================================== diff --git a/examples/cookbook/basics-tutorial/1-basics.test.tsx b/examples/cookbook/basics-tutorial/1-basics.test.tsx index 080bc6b4e..518b8fa50 100644 --- a/examples/cookbook/basics-tutorial/1-basics.test.tsx +++ b/examples/cookbook/basics-tutorial/1-basics.test.tsx @@ -12,11 +12,10 @@ * - Encourages testing behavior rather than implementation details */ -import * as React from 'react'; -import { Text, View } from 'react-native'; - // Import the essential testing utilities from React Native Testing Library import { render, screen } from '@testing-library/react-native'; +import * as React from 'react'; +import { Text, View } from 'react-native'; // - render: Creates a virtual representation of your component for testing // - screen: Provides convenient methods to query rendered elements diff --git a/examples/cookbook/basics-tutorial/2.1-query-variants.test.tsx b/examples/cookbook/basics-tutorial/2.1-query-variants.test.tsx index a2c4546fe..16c1101e5 100644 --- a/examples/cookbook/basics-tutorial/2.1-query-variants.test.tsx +++ b/examples/cookbook/basics-tutorial/2.1-query-variants.test.tsx @@ -10,9 +10,9 @@ * that returns arrays of elements instead of single elements. */ +import { render, screen } from '@testing-library/react-native'; import * as React from 'react'; import { Text, View } from 'react-native'; -import { render, screen } from '@testing-library/react-native'; /** * TEST 1: Basic Query Variants diff --git a/examples/cookbook/basics-tutorial/2.2-query-predicates.test.tsx b/examples/cookbook/basics-tutorial/2.2-query-predicates.test.tsx index 4474935d3..3ca19e20e 100644 --- a/examples/cookbook/basics-tutorial/2.2-query-predicates.test.tsx +++ b/examples/cookbook/basics-tutorial/2.2-query-predicates.test.tsx @@ -18,9 +18,9 @@ * - When to use testID as a last resort */ +import { render, screen } from '@testing-library/react-native'; import * as React from 'react'; import { Pressable, Switch, Text, TextInput, View } from 'react-native'; -import { render, screen } from '@testing-library/react-native'; /** * Test 1: Query by semantic role with predicates diff --git a/examples/cookbook/basics-tutorial/3-jest-matchers.test.tsx b/examples/cookbook/basics-tutorial/3-jest-matchers.test.tsx index e7bcb46e8..ab19734bf 100644 --- a/examples/cookbook/basics-tutorial/3-jest-matchers.test.tsx +++ b/examples/cookbook/basics-tutorial/3-jest-matchers.test.tsx @@ -14,8 +14,8 @@ * - expect(element).not.toBeOnTheScreen() - asserts element is NOT rendered */ -import * as React from 'react'; import { render, screen } from '@testing-library/react-native'; +import * as React from 'react'; import { Text, TextInput, View } from 'react-native'; /** @@ -70,7 +70,9 @@ test('showcase: toHaveTextContent', async () => { expect(screen.getByTestId('text')).toHaveTextContent(/hello/i); // Partial text match - useful when you only care about part of the text - expect(screen.getByTestId('text')).toHaveTextContent('Hello', { exact: false }); + expect(screen.getByTestId('text')).toHaveTextContent('Hello', { + exact: false, + }); }); /** @@ -186,7 +188,11 @@ test('showcase: toHaveAccessibilityValue', async () => { expect(screen.getByTestId('view')).toHaveAccessibilityValue({ now: 33 }); // Check multiple accessibility values at once - expect(screen.getByTestId('view')).toHaveAccessibilityValue({ now: 33, min: 0, max: 100 }); + expect(screen.getByTestId('view')).toHaveAccessibilityValue({ + now: 33, + min: 0, + max: 100, + }); }); /** @@ -425,7 +431,9 @@ test('showcase: toHaveStyle', async () => { expect(screen.getByTestId('view')).toHaveStyle({ backgroundColor: 'red' }); // Test incorrect style property - expect(screen.getByTestId('view')).not.toHaveStyle({ backgroundColor: 'blue' }); + expect(screen.getByTestId('view')).not.toHaveStyle({ + backgroundColor: 'blue', + }); }); /** diff --git a/examples/cookbook/basics-tutorial/4-events.test.tsx b/examples/cookbook/basics-tutorial/4-events.test.tsx index 2c6df301d..a7405e2f1 100644 --- a/examples/cookbook/basics-tutorial/4-events.test.tsx +++ b/examples/cookbook/basics-tutorial/4-events.test.tsx @@ -14,9 +14,9 @@ * - Testing error states triggered by events */ +import { render, screen, userEvent } from '@testing-library/react-native'; import * as React from 'react'; import { Text, View, Pressable, TextInput } from 'react-native'; -import { render, screen, userEvent } from '@testing-library/react-native'; /* * Example 1: Basic Counter Component with Press Events diff --git a/examples/cookbook/basics-tutorial/5-screen-object.test.tsx b/examples/cookbook/basics-tutorial/5-screen-object.test.tsx index 444ef712b..c95e73c7d 100644 --- a/examples/cookbook/basics-tutorial/5-screen-object.test.tsx +++ b/examples/cookbook/basics-tutorial/5-screen-object.test.tsx @@ -13,9 +13,9 @@ * - Consistent API across all tests */ +import { render, screen } from '@testing-library/react-native'; import * as React from 'react'; import { Text, View } from 'react-native'; -import { render, screen } from '@testing-library/react-native'; // Simple component for demonstration function Greeting({ name = 'World' }) { diff --git a/experiments-app/.prettierrc.js b/experiments-app/.prettierrc.js deleted file mode 100644 index 14f748e9f..000000000 --- a/experiments-app/.prettierrc.js +++ /dev/null @@ -1,5 +0,0 @@ -// added for Jest inline snapshots to not use default Prettier config -module.exports = { - singleQuote: true, - trailingComma: 'es5', -}; diff --git a/experiments-app/App.tsx b/experiments-app/App.tsx index e8feee905..0cdc29477 100644 --- a/experiments-app/App.tsx +++ b/experiments-app/App.tsx @@ -1,9 +1,10 @@ -import * as React from 'react'; -import { StatusBar } from 'expo-status-bar'; import { NavigationContainer } from '@react-navigation/native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; -import { MainScreen } from './src/MainScreen'; +import { StatusBar } from 'expo-status-bar'; +import * as React from 'react'; + import { experiments } from './src/experiments'; +import { MainScreen } from './src/MainScreen'; const Stack = createNativeStackNavigator(); diff --git a/experiments-app/src/MainScreen.tsx b/experiments-app/src/MainScreen.tsx index 436356495..0350549d8 100644 --- a/experiments-app/src/MainScreen.tsx +++ b/experiments-app/src/MainScreen.tsx @@ -1,6 +1,7 @@ +import { useNavigation } from '@react-navigation/native'; import * as React from 'react'; import { StyleSheet, SafeAreaView, Text, FlatList, Pressable } from 'react-native'; -import { useNavigation } from '@react-navigation/native'; + import { Experiment, experiments } from './experiments'; export function MainScreen() { diff --git a/experiments-app/src/experiments.ts b/experiments-app/src/experiments.ts index af889cfb1..8d8a43bb7 100644 --- a/experiments-app/src/experiments.ts +++ b/experiments-app/src/experiments.ts @@ -1,10 +1,10 @@ import { AccessibilityScreen } from './screens/Accessibility'; +import { FlatListEvents } from './screens/FlatListEvents'; import { PressEvents } from './screens/PressEvents'; -import { TextInputEventPropagation } from './screens/TextInputEventPropagation'; -import { TextInputEvents } from './screens/TextInputEvents'; import { ScrollViewEvents } from './screens/ScrollViewEvents'; -import { FlatListEvents } from './screens/FlatListEvents'; import { SectionListEvents } from './screens/SectionListEvents'; +import { TextInputEventPropagation } from './screens/TextInputEventPropagation'; +import { TextInputEvents } from './screens/TextInputEvents'; export type Experiment = (typeof experiments)[number]; diff --git a/experiments-app/src/screens/FlatListEvents.tsx b/experiments-app/src/screens/FlatListEvents.tsx index 7121de53c..abfdcfb69 100644 --- a/experiments-app/src/screens/FlatListEvents.tsx +++ b/experiments-app/src/screens/FlatListEvents.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { FlatList, StyleSheet, Text, View } from 'react-native'; + import { customEventLogger, nativeEventLogger } from '../utils/helpers'; interface ItemData { diff --git a/experiments-app/src/screens/PressEvents.tsx b/experiments-app/src/screens/PressEvents.tsx index a8ba3edcc..de7c20513 100644 --- a/experiments-app/src/screens/PressEvents.tsx +++ b/experiments-app/src/screens/PressEvents.tsx @@ -8,6 +8,7 @@ import { Pressable, TouchableOpacity, } from 'react-native'; + import { nativeEventLogger, logEvent } from '../utils/helpers'; export function PressEvents() { diff --git a/experiments-app/src/screens/ScrollViewEvents.tsx b/experiments-app/src/screens/ScrollViewEvents.tsx index 0c3ddce4f..22ba15986 100644 --- a/experiments-app/src/screens/ScrollViewEvents.tsx +++ b/experiments-app/src/screens/ScrollViewEvents.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { StyleSheet, Text, ScrollView } from 'react-native'; + import { customEventLogger, nativeEventLogger } from '../utils/helpers'; export function ScrollViewEvents() { diff --git a/experiments-app/src/screens/SectionListEvents.tsx b/experiments-app/src/screens/SectionListEvents.tsx index dd169072b..a306a3475 100644 --- a/experiments-app/src/screens/SectionListEvents.tsx +++ b/experiments-app/src/screens/SectionListEvents.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { StyleSheet, Text, View, SectionList } from 'react-native'; + import { customEventLogger, nativeEventLogger } from '../utils/helpers'; interface SectionData { diff --git a/experiments-app/src/screens/TextInputEventPropagation.tsx b/experiments-app/src/screens/TextInputEventPropagation.tsx index 0e52a2b4b..445ff1dd9 100644 --- a/experiments-app/src/screens/TextInputEventPropagation.tsx +++ b/experiments-app/src/screens/TextInputEventPropagation.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { StyleSheet, SafeAreaView, TextInput, Pressable } from 'react-native'; + import { nativeEventLogger } from '../utils/helpers'; export function TextInputEventPropagation() { diff --git a/experiments-app/src/screens/TextInputEvents.tsx b/experiments-app/src/screens/TextInputEvents.tsx index afda93965..010c23c91 100644 --- a/experiments-app/src/screens/TextInputEvents.tsx +++ b/experiments-app/src/screens/TextInputEvents.tsx @@ -1,5 +1,6 @@ import * as React from 'react'; import { StyleSheet, SafeAreaView, TextInput } from 'react-native'; + import { nativeEventLogger, logEvent } from '../utils/helpers'; export function TextInputEvents() { diff --git a/package.json b/package.json index 04f2cc96d..5ae05614c 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,12 @@ "typecheck": "tsc", "typecheck:react-19_2": "tsc -p tsconfig.react-19_2.json", "lint": "eslint src --cache", - "prettier": "prettier --check .", - "prettier:fix": "prettier --write .", - "validate": "yarn typecheck && yarn test && yarn lint && yarn prettier", + "format:check": "oxfmt --check .", + "format:fix": "oxfmt --write .", + "validate": "yarn typecheck && yarn test && yarn lint && yarn format:check", "validate:examples": "yarn --cwd examples/basic validate && yarn --cwd examples/cookbook validate", "validate:all": "yarn validate && yarn validate:examples && yarn docs:check && yarn --cwd website validate && yarn --cwd experiments-app validate", - "validate:fix": "yarn prettier:fix && yarn lint --fix && yarn typecheck && yarn test -u && docs:generate", + "validate:fix": "yarn format:fix && yarn lint --fix && yarn typecheck && yarn test -u && yarn docs:generate", "build:js": "babel src --out-dir dist --extensions \".js,.ts,.jsx,.tsx\" --source-maps --ignore \"**/__tests__/**\"", "build:ts": "tsc --build tsconfig.release.json", "build": "yarn clean && yarn build:js && yarn build:ts", @@ -93,9 +93,8 @@ "babel-plugin-module-resolver": "^5.0.3", "del-cli": "^7.0.0", "eslint": "^10.4.0", - "eslint-plugin-simple-import-sort": "^13.0.0", "jest": "^30.4.2", - "prettier": "^3.8.3", + "oxfmt": "^0.52.0", "react": "19.2.3", "react-native": "0.85.3", "release-it": "^20.0.1", diff --git a/prettier.config.js b/prettier.config.js deleted file mode 100644 index 9c95a9f6a..000000000 --- a/prettier.config.js +++ /dev/null @@ -1,5 +0,0 @@ -// added for Jest inline snapshots to not use default Prettier config -module.exports = { - singleQuote: true, - trailingComma: 'all', -}; diff --git a/scripts/generate-package-docs.mjs b/scripts/generate-package-docs.mjs index bb81faa6a..1f64a4f20 100644 --- a/scripts/generate-package-docs.mjs +++ b/scripts/generate-package-docs.mjs @@ -1,6 +1,6 @@ +import { execFileSync } from 'node:child_process'; import fs from 'node:fs'; import path from 'node:path'; -import { execFileSync } from 'node:child_process'; import { fileURLToPath } from 'node:url'; const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); @@ -160,7 +160,10 @@ const pages = [ ]; for (const generatedPath of generatedPaths) { - fs.rmSync(path.join(generatedRoot, generatedPath), { recursive: true, force: true }); + fs.rmSync(path.join(generatedRoot, generatedPath), { + recursive: true, + force: true, + }); } fs.mkdirSync(generatedRoot, { recursive: true }); @@ -185,8 +188,11 @@ fs.writeFileSync(path.join(generatedRoot, 'README.md'), buildReadme(writtenPages execFileSync( 'yarn', - ['prettier', '--write', 'docs/README.md', 'docs/api', 'docs/guides', 'docs/cookbook'], - { cwd: repoRoot, stdio: 'inherit' }, + ['oxfmt', '--write', 'docs/README.md', 'docs/api', 'docs/guides', 'docs/cookbook'], + { + cwd: repoRoot, + stdio: 'inherit', + }, ); console.log(`Generated package docs from website/docs/${docsVersion}`); diff --git a/scripts/test-codemods.mjs b/scripts/test-codemods.mjs index 7b6f44565..1922a53e8 100644 --- a/scripts/test-codemods.mjs +++ b/scripts/test-codemods.mjs @@ -1,8 +1,8 @@ #!/usr/bin/env node import { execSync } from 'child_process'; -import { fileURLToPath } from 'url'; import { dirname, join } from 'path'; +import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/skills/react-native-testing/references/api-reference-v13.md b/skills/react-native-testing/references/api-reference-v13.md index bcde51250..ccba7b427 100644 --- a/skills/react-native-testing/references/api-reference-v13.md +++ b/skills/react-native-testing/references/api-reference-v13.md @@ -465,8 +465,16 @@ Unmounts rendered trees and clears `screen`. Automatic after each test (if test ```ts function renderHook( hookFn: (props?: Props) => Result, - options?: { initialProps?: Props; wrapper?: React.ComponentType; concurrentRoot?: boolean }, -): { result: { current: Result }; rerender: (props: Props) => void; unmount: () => void }; + options?: { + initialProps?: Props; + wrapper?: React.ComponentType; + concurrentRoot?: boolean; + }, +): { + result: { current: Result }; + rerender: (props: Props) => void; + unmount: () => void; +}; ``` ### renderHookAsync (v13.3+) @@ -474,7 +482,11 @@ function renderHook( ```ts async function renderHookAsync( hookFn: (props?: Props) => Result, - options?: { initialProps?: Props; wrapper?: React.ComponentType; concurrentRoot?: boolean }, + options?: { + initialProps?: Props; + wrapper?: React.ComponentType; + concurrentRoot?: boolean; + }, ): Promise<{ result: { current: Result }; rerenderAsync: (props: Props) => Promise; diff --git a/src/__tests__/fire-event.test.tsx b/src/__tests__/fire-event.test.tsx index e70b66e9a..0f99ff98d 100644 --- a/src/__tests__/fire-event.test.tsx +++ b/src/__tests__/fire-event.test.tsx @@ -262,7 +262,9 @@ describe('fireEvent.scroll', () => { , ); const scrollView = screen.getByTestId('scroll'); - const customEventData = { nativeEvent: { contentOffset: { x: 50, y: 200 } } }; + const customEventData = { + nativeEvent: { contentOffset: { x: 50, y: 200 } }, + }; await fireEvent.scroll(scrollView, customEventData); expect(onScroll.mock.calls[0][0]).toMatchInlineSnapshot(` { @@ -315,7 +317,10 @@ describe('fireEvent.scroll', () => { const scrollView = screen.getByTestId('scroll'); await fireEvent.scroll(scrollView, verticalScrollEvent); expect(onScroll.mock.calls[0][0]).toMatchObject(verticalScrollEvent); - expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ x: 0, y: 200 }); + expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ + x: 0, + y: 200, + }); }); test.each([ @@ -330,7 +335,10 @@ describe('fireEvent.scroll', () => { const scrollView = screen.getByTestId('scroll'); await fireEvent(scrollView, eventName, verticalScrollEvent); expect(handler).toHaveBeenCalledWith(verticalScrollEvent); - expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ x: 0, y: 200 }); + expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ + x: 0, + y: 200, + }); }); test('without contentOffset scrolls to (0, 0)', async () => { @@ -345,7 +353,10 @@ describe('fireEvent.scroll', () => { expect(onScroll.mock.calls[0][0]).toMatchObject({ nativeEvent: { contentOffset: { x: 0, y: 0 } }, }); - expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ x: 0, y: 0 }); + expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ + x: 0, + y: 0, + }); }); test('with non-finite contentOffset values uses 0', async () => { @@ -360,7 +371,10 @@ describe('fireEvent.scroll', () => { nativeEvent: { contentOffset: { y: Infinity } }, }); expect(onScroll).toHaveBeenCalled(); - expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ x: 0, y: 0 }); + expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ + x: 0, + y: 0, + }); }); test('with horizontal scroll updates native state', async () => { @@ -373,7 +387,10 @@ describe('fireEvent.scroll', () => { const scrollView = screen.getByTestId('scroll'); await fireEvent.scroll(scrollView, horizontalScrollEvent); expect(onScroll.mock.calls[0][0]).toMatchObject(horizontalScrollEvent); - expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ x: 50, y: 0 }); + expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ + x: 50, + y: 0, + }); }); test('without contentOffset via fireEvent() does not update native state', async () => { @@ -401,7 +418,10 @@ describe('fireEvent.scroll', () => { nativeEvent: { contentOffset: { x: Infinity } }, }); expect(onScroll).toHaveBeenCalled(); - expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ x: 0, y: 0 }); + expect(nativeState.contentOffsetForInstance.get(scrollView)).toEqual({ + x: 0, + y: 0, + }); }); }); @@ -689,8 +709,12 @@ describe('non-editable TextInput', () => { await fireEvent(subject, 'focus'); await fireEvent(subject, 'onFocus'); await fireEvent.changeText(subject, 'Text'); - await fireEvent(subject, 'submitEditing', { nativeEvent: { text: 'Text' } }); - await fireEvent(subject, 'onSubmitEditing', { nativeEvent: { text: 'Text' } }); + await fireEvent(subject, 'submitEditing', { + nativeEvent: { text: 'Text' }, + }); + await fireEvent(subject, 'onSubmitEditing', { + nativeEvent: { text: 'Text' }, + }); await fireEvent(subject, 'layout', layoutEvent); await fireEvent(subject, 'onLayout', layoutEvent); diff --git a/src/event-builder/__tests__/scroll.test.ts b/src/event-builder/__tests__/scroll.test.ts index 90363934c..7ae6d6c70 100644 --- a/src/event-builder/__tests__/scroll.test.ts +++ b/src/event-builder/__tests__/scroll.test.ts @@ -30,5 +30,8 @@ test('buildScrollEvent uses provided options', () => { ); expect(event.nativeEvent.contentSize).toEqual({ height: 1000, width: 400 }); - expect(event.nativeEvent.layoutMeasurement).toEqual({ height: 800, width: 400 }); + expect(event.nativeEvent.layoutMeasurement).toEqual({ + height: 800, + width: 400, + }); }); diff --git a/src/event-builder/__tests__/text.test.ts b/src/event-builder/__tests__/text.test.ts index 98b5f6bdd..963c479ae 100644 --- a/src/event-builder/__tests__/text.test.ts +++ b/src/event-builder/__tests__/text.test.ts @@ -10,7 +10,11 @@ import { test('buildTextChangeEvent returns event with text', () => { const event = buildTextChangeEvent('Hello'); - expect(event.nativeEvent).toEqual({ text: 'Hello', target: 0, eventCount: 0 }); + expect(event.nativeEvent).toEqual({ + text: 'Hello', + target: 0, + eventCount: 0, + }); }); test('buildKeyPressEvent returns event with key', () => { diff --git a/src/fire-event.ts b/src/fire-event.ts index 18897a145..88991376c 100644 --- a/src/fire-event.ts +++ b/src/fire-event.ts @@ -97,7 +97,9 @@ function findEventHandlerFromFiber(fiber: Fiber | null, eventName: string): Even return null; } - const handler = getEventHandlerFromProps(fiber.memoizedProps, eventName, { loose: true }); + const handler = getEventHandlerFromProps(fiber.memoizedProps, eventName, { + loose: true, + }); if (handler) { return handler; } diff --git a/src/helpers/__tests__/accessibility.test.tsx b/src/helpers/__tests__/accessibility.test.tsx index 700c209c5..db52a43d1 100644 --- a/src/helpers/__tests__/accessibility.test.tsx +++ b/src/helpers/__tests__/accessibility.test.tsx @@ -293,7 +293,9 @@ describe('isHiddenFromAccessibility', () => { , ); - const element = screen.getByTestId('subject', { includeHiddenElements: true }); + const element = screen.getByTestId('subject', { + includeHiddenElements: true, + }); const cache = new WeakMap(); // First call populates the cache diff --git a/src/helpers/__tests__/include-hidden-elements.test.tsx b/src/helpers/__tests__/include-hidden-elements.test.tsx index 03c9ddd3a..0d5ba24e8 100644 --- a/src/helpers/__tests__/include-hidden-elements.test.tsx +++ b/src/helpers/__tests__/include-hidden-elements.test.tsx @@ -6,7 +6,12 @@ import { configure, render, screen } from '../..'; test('includeHiddenElements query option takes priority over hidden option and global config', async () => { configure({ defaultHidden: true, defaultIncludeHiddenElements: true }); await render(); - expect(screen.queryByTestId('view', { includeHiddenElements: false, hidden: true })).toBeFalsy(); + expect( + screen.queryByTestId('view', { + includeHiddenElements: false, + hidden: true, + }), + ).toBeFalsy(); }); test('hidden option takes priority over global config when includeHiddenElements is not defined', async () => { diff --git a/src/matchers/to-be-on-the-screen.ts b/src/matchers/to-be-on-the-screen.ts index 3605fc42f..7c9d16f20 100644 --- a/src/matchers/to-be-on-the-screen.ts +++ b/src/matchers/to-be-on-the-screen.ts @@ -15,10 +15,7 @@ export function toBeOnTheScreen(this: jest.MatcherContext, instance: TestInstanc const pass = instance === null ? false : screen.container === getContainerInstance(instance); const errorFound = () => { - return `expected instance tree not to contain instance, but found\n${redent( - formatElement(instance), - 2, - )}`; + return `expected instance tree not to contain instance, but found\n${redent(formatElement(instance), 2)}`; }; const errorNotFound = () => { diff --git a/src/matchers/to-be-visible.ts b/src/matchers/to-be-visible.ts index 0156da399..d2f7d10e5 100644 --- a/src/matchers/to-be-visible.ts +++ b/src/matchers/to-be-visible.ts @@ -1,5 +1,5 @@ -import { StyleSheet } from 'react-native'; import { matcherHint } from 'jest-matcher-utils'; +import { StyleSheet } from 'react-native'; import redent from 'redent'; import type { TestInstance } from 'test-renderer'; diff --git a/src/matchers/to-have-style.ts b/src/matchers/to-have-style.ts index d8455a5b3..d6636a16c 100644 --- a/src/matchers/to-have-style.ts +++ b/src/matchers/to-have-style.ts @@ -1,6 +1,6 @@ +import { diff, matcherHint } from 'jest-matcher-utils'; import type { ImageStyle, StyleProp, TextStyle, ViewStyle } from 'react-native'; import { StyleSheet } from 'react-native'; -import { diff, matcherHint } from 'jest-matcher-utils'; import type { TestInstance } from 'test-renderer'; import { checkHostElement, formatMessage } from './utils'; diff --git a/src/queries/__tests__/role.test.tsx b/src/queries/__tests__/role.test.tsx index 3b10fdc29..9ef211dad 100644 --- a/src/queries/__tests__/role.test.tsx +++ b/src/queries/__tests__/role.test.tsx @@ -853,8 +853,13 @@ describe('error messages', () => { test('gives a descriptive error message when querying with a role, a name and several accessibility state', async () => { await render(); - expect(() => screen.getByRole('button', { name: 'Save', disabled: true, selected: true })) - .toThrowErrorMatchingInlineSnapshot(` + expect(() => + screen.getByRole('button', { + name: 'Save', + disabled: true, + selected: true, + }), + ).toThrowErrorMatchingInlineSnapshot(` "Unable to find an element with role: button, name: Save, disabled state: true, selected state: true " diff --git a/src/user-event/press/__tests__/longPress.real-timers.test.tsx b/src/user-event/press/__tests__/longPress.real-timers.test.tsx index 8f54cb22e..6fad2e043 100644 --- a/src/user-event/press/__tests__/longPress.real-timers.test.tsx +++ b/src/user-event/press/__tests__/longPress.real-timers.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { Pressable, Text, TouchableHighlight, TouchableOpacity } from 'react-native'; +import { userEvent } from '../..'; import { render, screen } from '../../..'; import { createEventLogger, getEventsNames } from '../../../test-utils/events'; -import { userEvent } from '../..'; describe('userEvent.longPress with real timers', () => { beforeEach(() => { diff --git a/src/user-event/press/__tests__/longPress.test.tsx b/src/user-event/press/__tests__/longPress.test.tsx index de5341d70..f836eeafd 100644 --- a/src/user-event/press/__tests__/longPress.test.tsx +++ b/src/user-event/press/__tests__/longPress.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { Pressable, Text, TouchableHighlight, TouchableOpacity, View } from 'react-native'; +import { userEvent } from '../..'; import { render, screen } from '../../..'; import { createEventLogger, getEventsNames } from '../../../test-utils/events'; -import { userEvent } from '../..'; describe('userEvent.longPress with fake timers', () => { beforeEach(() => { diff --git a/src/user-event/press/__tests__/press.real-timers.test.tsx b/src/user-event/press/__tests__/press.real-timers.test.tsx index ccf4b8cc5..bd9d44748 100644 --- a/src/user-event/press/__tests__/press.real-timers.test.tsx +++ b/src/user-event/press/__tests__/press.real-timers.test.tsx @@ -9,9 +9,9 @@ import { View, } from 'react-native'; +import { userEvent } from '../..'; import { render, screen } from '../../..'; import { createEventLogger, getEventsNames } from '../../../test-utils/events'; -import { userEvent } from '../..'; describe('userEvent.press with real timers', () => { beforeEach(() => { diff --git a/src/user-event/press/__tests__/press.test.tsx b/src/user-event/press/__tests__/press.test.tsx index 1d105014b..7ab2eb80a 100644 --- a/src/user-event/press/__tests__/press.test.tsx +++ b/src/user-event/press/__tests__/press.test.tsx @@ -9,9 +9,9 @@ import { View, } from 'react-native'; +import { userEvent } from '../..'; import { render, screen } from '../../..'; import { createEventLogger, getEventsNames } from '../../../test-utils/events'; -import { userEvent } from '../..'; describe('userEvent.press with fake timers', () => { beforeEach(() => { diff --git a/src/user-event/scroll/__tests__/scroll-to-flat-list.test.tsx b/src/user-event/scroll/__tests__/scroll-to-flat-list.test.tsx index b4a6aad14..80141ee77 100644 --- a/src/user-event/scroll/__tests__/scroll-to-flat-list.test.tsx +++ b/src/user-event/scroll/__tests__/scroll-to-flat-list.test.tsx @@ -2,10 +2,10 @@ import * as React from 'react'; import type { ScrollViewProps } from 'react-native'; import { FlatList, Text, View } from 'react-native'; +import { userEvent } from '../..'; import { render, screen } from '../../..'; import type { EventEntry } from '../../../test-utils/events'; import { createEventLogger } from '../../../test-utils/events'; -import { userEvent } from '../..'; const data = ['A', 'B', 'C', 'D', 'E', 'F', 'G']; diff --git a/src/user-event/scroll/__tests__/scroll-to.test.tsx b/src/user-event/scroll/__tests__/scroll-to.test.tsx index 10672aa45..d0ff2a9dd 100644 --- a/src/user-event/scroll/__tests__/scroll-to.test.tsx +++ b/src/user-event/scroll/__tests__/scroll-to.test.tsx @@ -2,10 +2,10 @@ import * as React from 'react'; import type { ScrollViewProps } from 'react-native'; import { ScrollView, View } from 'react-native'; +import { userEvent } from '../..'; import { fireEvent, render, screen } from '../../..'; import type { EventEntry } from '../../../test-utils/events'; import { createEventLogger } from '../../../test-utils/events'; -import { userEvent } from '../..'; function mapEventsToShortForm(events: EventEntry[]) { return events.map((e) => [ diff --git a/src/user-event/scroll/scroll-to.ts b/src/user-event/scroll/scroll-to.ts index 3256f53d0..d9652ca43 100644 --- a/src/user-event/scroll/scroll-to.ts +++ b/src/user-event/scroll/scroll-to.ts @@ -57,7 +57,10 @@ export async function scrollTo( options.contentSize?.height ?? 0, ); - const initialOffset = nativeState.contentOffsetForInstance.get(instance) ?? { x: 0, y: 0 }; + const initialOffset = nativeState.contentOffsetForInstance.get(instance) ?? { + x: 0, + y: 0, + }; const dragSteps = createScrollSteps( { y: options.y, x: options.x }, initialOffset, diff --git a/src/user-event/type/__tests__/type-managed.test.tsx b/src/user-event/type/__tests__/type-managed.test.tsx index 7800c02a0..7a37eab8c 100644 --- a/src/user-event/type/__tests__/type-managed.test.tsx +++ b/src/user-event/type/__tests__/type-managed.test.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; import { TextInput } from 'react-native'; +import { userEvent } from '../..'; import { render, screen } from '../../..'; import { createEventLogger, getEventsNames } from '../../../test-utils/events'; -import { userEvent } from '../..'; beforeEach(() => { jest.useRealTimers(); diff --git a/src/user-event/type/__tests__/type.test.tsx b/src/user-event/type/__tests__/type.test.tsx index e193471ee..a96fb7512 100644 --- a/src/user-event/type/__tests__/type.test.tsx +++ b/src/user-event/type/__tests__/type.test.tsx @@ -2,9 +2,9 @@ import * as React from 'react'; import type { TextInputProps } from 'react-native'; import { TextInput, View } from 'react-native'; +import { userEvent } from '../..'; import { render, screen } from '../../..'; import { createEventLogger, getEventsNames, lastEventPayload } from '../../../test-utils/events'; -import { userEvent } from '../..'; beforeEach(() => { jest.useRealTimers(); diff --git a/website/.prettierrc.js b/website/.prettierrc.js deleted file mode 100644 index 6a44ba06e..000000000 --- a/website/.prettierrc.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - singleQuote: true, - trailingComma: 'es5', - overrides: [ - { - files: '*.css', - options: { - printWidth: 120, - }, - }, - ], -}; diff --git a/website/docs/12.x/cookbook/basics/async-tests.md b/website/docs/12.x/cookbook/basics/async-tests.md index 43e431402..ebc577852 100644 --- a/website/docs/12.x/cookbook/basics/async-tests.md +++ b/website/docs/12.x/cookbook/basics/async-tests.md @@ -32,7 +32,7 @@ test('User can sign in with correct credentials', async () => { // Follow-up assertions do not need to be async, as we already waited for sign in operation to complete expect( - screen.queryByRole('header', { name: 'Sign in to Hello World App' }) + screen.queryByRole('header', { name: 'Sign in to Hello World App' }), ).not.toBeOnTheScreen(); expect(screen.queryByLabelText('Username')).not.toBeOnTheScreen(); expect(screen.queryByLabelText('Password')).not.toBeOnTheScreen(); @@ -87,7 +87,7 @@ function waitFor( options?: { timeout: number; interval: number; - } + }, ): Promise; ``` @@ -111,7 +111,7 @@ function waitForElementToBeRemoved( options?: { timeout: number; interval: number; - } + }, ): Promise {} ``` diff --git a/website/docs/12.x/cookbook/basics/custom-render.md b/website/docs/12.x/cookbook/basics/custom-render.md index 6d1d88ffd..17b626ba2 100644 --- a/website/docs/12.x/cookbook/basics/custom-render.md +++ b/website/docs/12.x/cookbook/basics/custom-render.md @@ -16,12 +16,12 @@ interface RenderWithProvidersProps { export function renderWithProviders( ui: React.ReactElement, - options?: RenderWithProvidersProps + options?: RenderWithProvidersProps, ) { return render( {ui} - + , ); } ``` diff --git a/website/docs/12.x/cookbook/state-management/jotai.md b/website/docs/12.x/cookbook/state-management/jotai.md index 0e0c72e88..8471367c0 100644 --- a/website/docs/12.x/cookbook/state-management/jotai.md +++ b/website/docs/12.x/cookbook/state-management/jotai.md @@ -110,10 +110,10 @@ export interface RenderWithAtomsOptions { */ export const renderWithAtoms = ( component: React.ReactElement, - options: RenderWithAtomsOptions + options: RenderWithAtomsOptions, ) => { return render( - {component} + {component}, ); }; diff --git a/website/docs/12.x/docs/api/events/fire-event.mdx b/website/docs/12.x/docs/api/events/fire-event.mdx index b051401c6..1877b8214 100644 --- a/website/docs/12.x/docs/api/events/fire-event.mdx +++ b/website/docs/12.x/docs/api/events/fire-event.mdx @@ -23,7 +23,7 @@ test('fire changeText event', () => { render( // MyComponent renders TextInput which has a placeholder 'Enter details' // and with `onChangeText` bound to handleChangeText - + , ); fireEvent(screen.getByPlaceholderText('change'), 'onChangeText', 'ab'); @@ -46,7 +46,7 @@ const onBlurMock = jest.fn(); render( - + , ); // you can omit the `on` prefix @@ -84,7 +84,7 @@ render( Press me - + , ); fireEvent.press(screen.getByText('Press me'), eventData); @@ -113,7 +113,7 @@ const CHANGE_TEXT = 'content'; render( - + , ); fireEvent.changeText(screen.getByPlaceholderText('Enter data'), CHANGE_TEXT); @@ -145,7 +145,7 @@ const eventData = { render( XD - + , ); fireEvent.scroll(screen.getByText('scroll-view'), eventData); diff --git a/website/docs/12.x/docs/api/misc/async.mdx b/website/docs/12.x/docs/api/misc/async.mdx index d2bdd75d6..f04e08501 100644 --- a/website/docs/12.x/docs/api/misc/async.mdx +++ b/website/docs/12.x/docs/api/misc/async.mdx @@ -9,7 +9,7 @@ The `findBy*` queries are used to find elements that are not instantly available ```tsx function waitFor( expectation: () => T, - options?: { timeout: number; interval: number } + options?: { timeout: number; interval: number }, ): Promise; ``` @@ -109,7 +109,7 @@ If you receive warnings related to `act()` function consult our [Understanding A ```ts function waitForElementToBeRemoved( expectation: () => T, - options?: { timeout: number; interval: number } + options?: { timeout: number; interval: number }, ): Promise; ``` diff --git a/website/docs/12.x/docs/api/misc/render-hook.mdx b/website/docs/12.x/docs/api/misc/render-hook.mdx index 9fe20b543..c1b426d2e 100644 --- a/website/docs/12.x/docs/api/misc/render-hook.mdx +++ b/website/docs/12.x/docs/api/misc/render-hook.mdx @@ -3,7 +3,7 @@ ```ts function renderHook( callback: (props?: Props) => Result, - options?: RenderHookOptions + options?: RenderHookOptions, ): RenderHookResult; ``` diff --git a/website/docs/12.x/docs/api/queries.mdx b/website/docs/12.x/docs/api/queries.mdx index 480e73566..3a9a701df 100644 --- a/website/docs/12.x/docs/api/queries.mdx +++ b/website/docs/12.x/docs/api/queries.mdx @@ -183,7 +183,7 @@ import { render, screen } from '@testing-library/react-native'; render( Hello - + , ); const element = screen.getByRole('button'); const element2 = screen.getByRole('button', { name: 'Hello' }); @@ -398,13 +398,15 @@ render(Hidden from accessibility); expect( screen.queryByText('Hidden from accessibility', { includeHiddenElements: false, - }) + }), ).not.toBeOnTheScreen(); // Include hidden elements expect(screen.getByText('Hidden from accessibility')).toBeOnTheScreen(); expect( - screen.getByText('Hidden from accessibility', { includeHiddenElements: true }) + screen.getByText('Hidden from accessibility', { + includeHiddenElements: true, + }), ).toBeOnTheScreen(); ``` diff --git a/website/docs/12.x/docs/migration/_meta.json b/website/docs/12.x/docs/migration/_meta.json index fdaff4905..6da6f46a6 100644 --- a/website/docs/12.x/docs/migration/_meta.json +++ b/website/docs/12.x/docs/migration/_meta.json @@ -1,5 +1,10 @@ [ "v12", "jest-matchers", - { "type": "dir", "name": "previous", "label": "Previous versions", "collapsed": true } + { + "type": "dir", + "name": "previous", + "label": "Previous versions", + "collapsed": true + } ] diff --git a/website/docs/12.x/docs/migration/previous/v11.mdx b/website/docs/12.x/docs/migration/previous/v11.mdx index c803bc2b1..c1d81e888 100644 --- a/website/docs/12.x/docs/migration/previous/v11.mdx +++ b/website/docs/12.x/docs/migration/previous/v11.mdx @@ -24,7 +24,7 @@ function findByText(text: TextMatch, options?: TextMatchOptions, waitForOptions? function findAllByText( text: TextMatch, options?: TextMatchOptions, - waitForOptions?: WaitForOptions + waitForOptions?: WaitForOptions, ); ``` diff --git a/website/docs/12.x/docs/migration/previous/v9.mdx b/website/docs/12.x/docs/migration/previous/v9.mdx index 60557c566..362c341bb 100644 --- a/website/docs/12.x/docs/migration/previous/v9.mdx +++ b/website/docs/12.x/docs/migration/previous/v9.mdx @@ -37,7 +37,7 @@ In v1.14 we've introduced a feature allowing to match text when it's spread acro const { getByText } = render( Hello world - + , ); getByText('Hello world'); // matches ``` diff --git a/website/docs/13.x/cookbook/basics/async-tests.md b/website/docs/13.x/cookbook/basics/async-tests.md index 43e431402..ebc577852 100644 --- a/website/docs/13.x/cookbook/basics/async-tests.md +++ b/website/docs/13.x/cookbook/basics/async-tests.md @@ -32,7 +32,7 @@ test('User can sign in with correct credentials', async () => { // Follow-up assertions do not need to be async, as we already waited for sign in operation to complete expect( - screen.queryByRole('header', { name: 'Sign in to Hello World App' }) + screen.queryByRole('header', { name: 'Sign in to Hello World App' }), ).not.toBeOnTheScreen(); expect(screen.queryByLabelText('Username')).not.toBeOnTheScreen(); expect(screen.queryByLabelText('Password')).not.toBeOnTheScreen(); @@ -87,7 +87,7 @@ function waitFor( options?: { timeout: number; interval: number; - } + }, ): Promise; ``` @@ -111,7 +111,7 @@ function waitForElementToBeRemoved( options?: { timeout: number; interval: number; - } + }, ): Promise {} ``` diff --git a/website/docs/13.x/cookbook/basics/custom-render.md b/website/docs/13.x/cookbook/basics/custom-render.md index 6d1d88ffd..17b626ba2 100644 --- a/website/docs/13.x/cookbook/basics/custom-render.md +++ b/website/docs/13.x/cookbook/basics/custom-render.md @@ -16,12 +16,12 @@ interface RenderWithProvidersProps { export function renderWithProviders( ui: React.ReactElement, - options?: RenderWithProvidersProps + options?: RenderWithProvidersProps, ) { return render( {ui} - + , ); } ``` diff --git a/website/docs/13.x/cookbook/state-management/jotai.md b/website/docs/13.x/cookbook/state-management/jotai.md index 0e0c72e88..8471367c0 100644 --- a/website/docs/13.x/cookbook/state-management/jotai.md +++ b/website/docs/13.x/cookbook/state-management/jotai.md @@ -110,10 +110,10 @@ export interface RenderWithAtomsOptions { */ export const renderWithAtoms = ( component: React.ReactElement, - options: RenderWithAtomsOptions + options: RenderWithAtomsOptions, ) => { return render( - {component} + {component}, ); }; diff --git a/website/docs/13.x/docs/api/events/fire-event.mdx b/website/docs/13.x/docs/api/events/fire-event.mdx index 37c018a3e..56071ae42 100644 --- a/website/docs/13.x/docs/api/events/fire-event.mdx +++ b/website/docs/13.x/docs/api/events/fire-event.mdx @@ -25,7 +25,7 @@ test('fire changeText event', () => { render( // MyComponent renders TextInput which has a placeholder 'Enter details' // and with `onChangeText` bound to handleChangeText - + , ); fireEvent(screen.getByPlaceholderText('change'), 'onChangeText', 'ab'); @@ -48,7 +48,7 @@ const onBlurMock = jest.fn(); render( - + , ); // you can omit the `on` prefix @@ -89,7 +89,7 @@ render( Press me - + , ); fireEvent.press(screen.getByText('Press me'), eventData); @@ -121,7 +121,7 @@ const CHANGE_TEXT = 'content'; render( - + , ); fireEvent.changeText(screen.getByPlaceholderText('Enter data'), CHANGE_TEXT); @@ -160,7 +160,7 @@ const eventData = { render( XD - + , ); fireEvent.scroll(screen.getByText('scroll-view'), eventData); diff --git a/website/docs/13.x/docs/api/misc/async.mdx b/website/docs/13.x/docs/api/misc/async.mdx index f26d7ea3c..2c2ac1dec 100644 --- a/website/docs/13.x/docs/api/misc/async.mdx +++ b/website/docs/13.x/docs/api/misc/async.mdx @@ -9,7 +9,7 @@ The `findBy*` queries are used to find elements that are not instantly available ```tsx function waitFor( expectation: () => T, - options?: { timeout: number; interval: number } + options?: { timeout: number; interval: number }, ): Promise; ``` @@ -99,7 +99,7 @@ If you receive warnings related to `act()` function consult our [Understanding A ```ts function waitForElementToBeRemoved( expectation: () => T, - options?: { timeout: number; interval: number } + options?: { timeout: number; interval: number }, ): Promise; ``` diff --git a/website/docs/13.x/docs/api/misc/render-hook.mdx b/website/docs/13.x/docs/api/misc/render-hook.mdx index 1a024410b..d44541e1d 100644 --- a/website/docs/13.x/docs/api/misc/render-hook.mdx +++ b/website/docs/13.x/docs/api/misc/render-hook.mdx @@ -5,7 +5,7 @@ ```ts function renderHook( hookFn: (props?: Props) => Result, - options?: RenderHookOptions + options?: RenderHookOptions, ): RenderHookResult; ``` @@ -137,7 +137,7 @@ it('should use context value', () => { ```ts async function renderHookAsync( hookFn: (props?: Props) => Result, - options?: RenderHookOptions + options?: RenderHookOptions, ): Promise>; ``` diff --git a/website/docs/13.x/docs/api/queries.mdx b/website/docs/13.x/docs/api/queries.mdx index 2ecb4d7fe..04e77eab3 100644 --- a/website/docs/13.x/docs/api/queries.mdx +++ b/website/docs/13.x/docs/api/queries.mdx @@ -180,7 +180,7 @@ import { render, screen } from '@testing-library/react-native'; render( Hello - + , ); const element = screen.getByRole('button'); const element2 = screen.getByRole('button', { name: 'Hello' }); @@ -395,13 +395,15 @@ render(Hidden from accessibility); expect( screen.queryByText('Hidden from accessibility', { includeHiddenElements: false, - }) + }), ).not.toBeOnTheScreen(); // Include hidden elements expect(screen.getByText('Hidden from accessibility')).toBeOnTheScreen(); expect( - screen.getByText('Hidden from accessibility', { includeHiddenElements: true }) + screen.getByText('Hidden from accessibility', { + includeHiddenElements: true, + }), ).toBeOnTheScreen(); ``` diff --git a/website/docs/13.x/docs/api/render.mdx b/website/docs/13.x/docs/api/render.mdx index 9f014b99e..99d5c3f0d 100644 --- a/website/docs/13.x/docs/api/render.mdx +++ b/website/docs/13.x/docs/api/render.mdx @@ -78,7 +78,7 @@ This API requires RNTL v13.3.0 or later. ```tsx async function renderAsync( component: React.Element, - options?: RenderAsyncOptions + options?: RenderAsyncOptions, ): Promise; ``` diff --git a/website/docs/13.x/docs/guides/common-mistakes.mdx b/website/docs/13.x/docs/guides/common-mistakes.mdx index 984ce0635..210a29fed 100644 --- a/website/docs/13.x/docs/guides/common-mistakes.mdx +++ b/website/docs/13.x/docs/guides/common-mistakes.mdx @@ -34,7 +34,7 @@ test('finds input by label', () => { render( - + , ); // ✅ Good - uses accessible label @@ -65,7 +65,7 @@ test('uses role queries', () => { Submit - + , ); // ✅ Good - uses role query @@ -104,7 +104,7 @@ test('button is disabled', () => { render( Submit - + , ); const button = screen.getByRole('button', { name: 'Submit' }); @@ -139,7 +139,7 @@ test('checks non-existence', () => { render( Hello - + , ); // ✅ Good - uses queryBy for non-existence check @@ -243,7 +243,7 @@ test('finds element incorrectly', () => { const { UNSAFE_root } = render( Hello - + , ); // ❌ Bad - using UNSAFE_root directly @@ -293,7 +293,7 @@ test('renders component', () => { const { getByText } = render( Hello - + , ); expect(getByText('Hello')).toBeOnTheScreen(); @@ -310,7 +310,7 @@ test('renders component', () => { render( Hello - + , ); expect(screen.getByText('Hello')).toBeOnTheScreen(); @@ -422,7 +422,7 @@ test('finds text correctly', () => { render( Hello World - + , ); // ✅ Good - queries by visible text @@ -489,7 +489,7 @@ test('uses getBy as assertion', () => { render( Hello - + , ); // ✅ Good - getBy throws if not found, so it's an assertion diff --git a/website/docs/13.x/docs/migration/_meta.json b/website/docs/13.x/docs/migration/_meta.json index 43f91b8a8..ec3e5f4e8 100644 --- a/website/docs/13.x/docs/migration/_meta.json +++ b/website/docs/13.x/docs/migration/_meta.json @@ -1,5 +1,10 @@ [ "v13", "jest-matchers", - { "type": "dir", "name": "previous", "label": "Previous versions", "collapsed": true } + { + "type": "dir", + "name": "previous", + "label": "Previous versions", + "collapsed": true + } ] diff --git a/website/docs/13.x/docs/migration/previous/v11.mdx b/website/docs/13.x/docs/migration/previous/v11.mdx index c803bc2b1..c1d81e888 100644 --- a/website/docs/13.x/docs/migration/previous/v11.mdx +++ b/website/docs/13.x/docs/migration/previous/v11.mdx @@ -24,7 +24,7 @@ function findByText(text: TextMatch, options?: TextMatchOptions, waitForOptions? function findAllByText( text: TextMatch, options?: TextMatchOptions, - waitForOptions?: WaitForOptions + waitForOptions?: WaitForOptions, ); ``` diff --git a/website/docs/13.x/docs/migration/previous/v9.mdx b/website/docs/13.x/docs/migration/previous/v9.mdx index 5a914fad8..26dfa3258 100644 --- a/website/docs/13.x/docs/migration/previous/v9.mdx +++ b/website/docs/13.x/docs/migration/previous/v9.mdx @@ -37,7 +37,7 @@ In v1.14 we've introduced a feature allowing to match text when it's spread acro const { getByText } = render( Hello world - + , ); getByText('Hello world'); // matches ``` diff --git a/website/docs/14.x/cookbook/basics/async-events.md b/website/docs/14.x/cookbook/basics/async-events.md index e054e1cf2..b9a668105 100644 --- a/website/docs/14.x/cookbook/basics/async-events.md +++ b/website/docs/14.x/cookbook/basics/async-events.md @@ -33,7 +33,7 @@ test('User can sign in with correct credentials', async () => { // Follow-up assertions do not need to be async, as we already waited for sign in operation to complete expect( - screen.queryByRole('header', { name: 'Sign in to Hello World App' }) + screen.queryByRole('header', { name: 'Sign in to Hello World App' }), ).not.toBeOnTheScreen(); expect(screen.queryByLabelText('Username')).not.toBeOnTheScreen(); expect(screen.queryByLabelText('Password')).not.toBeOnTheScreen(); @@ -72,7 +72,7 @@ Each query has a default `timeout` value of 1000 ms and a default `interval` of const button = await screen.findByRole( 'button', { name: 'Start' }, - { timeout: 1000, interval: 50 } + { timeout: 1000, interval: 50 }, ); ``` @@ -92,7 +92,7 @@ function waitFor( options?: { timeout: number; interval: number; - } + }, ): Promise; ``` @@ -116,7 +116,7 @@ function waitForElementToBeRemoved( options?: { timeout: number; interval: number; - } + }, ): Promise {} ``` diff --git a/website/docs/14.x/cookbook/basics/custom-render.md b/website/docs/14.x/cookbook/basics/custom-render.md index aa3a645f7..4e8830ec2 100644 --- a/website/docs/14.x/cookbook/basics/custom-render.md +++ b/website/docs/14.x/cookbook/basics/custom-render.md @@ -16,12 +16,12 @@ interface RenderWithProvidersProps { export async function renderWithProviders( ui: React.ReactElement, - options?: RenderWithProvidersProps + options?: RenderWithProvidersProps, ) { return await render( {ui} - + , ); } ``` diff --git a/website/docs/14.x/cookbook/state-management/jotai.md b/website/docs/14.x/cookbook/state-management/jotai.md index e599ea362..3d6348b45 100644 --- a/website/docs/14.x/cookbook/state-management/jotai.md +++ b/website/docs/14.x/cookbook/state-management/jotai.md @@ -110,10 +110,10 @@ export interface RenderWithAtomsOptions { */ export async function renderWithAtoms( component: React.ReactElement, - options: RenderWithAtomsOptions + options: RenderWithAtomsOptions, ) { return await render( - {component} + {component}, ); } diff --git a/website/docs/14.x/docs/api/events/fire-event.mdx b/website/docs/14.x/docs/api/events/fire-event.mdx index 8ae476754..033441fae 100644 --- a/website/docs/14.x/docs/api/events/fire-event.mdx +++ b/website/docs/14.x/docs/api/events/fire-event.mdx @@ -28,7 +28,7 @@ test('fire changeText event', async () => { await render( // MyComponent renders TextInput which has a placeholder 'Enter details' // and with `onChangeText` bound to handleChangeText - + , ); await fireEvent(screen.getByPlaceholderText('change'), 'onChangeText', 'ab'); @@ -51,7 +51,7 @@ const onBlurMock = jest.fn(); await render( - + , ); // you can omit the `on` prefix @@ -92,7 +92,7 @@ await render( Press me - + , ); await fireEvent.press(screen.getByText('Press me'), eventData); @@ -124,7 +124,7 @@ const CHANGE_TEXT = 'content'; await render( - + , ); await fireEvent.changeText(screen.getByPlaceholderText('Enter data'), CHANGE_TEXT); @@ -163,7 +163,7 @@ const eventData = { await render( Content - + , ); await fireEvent.scroll(screen.getByTestId('scroll-view'), eventData); diff --git a/website/docs/14.x/docs/api/misc/async.mdx b/website/docs/14.x/docs/api/misc/async.mdx index be9d005d3..5a3dd6cc6 100644 --- a/website/docs/14.x/docs/api/misc/async.mdx +++ b/website/docs/14.x/docs/api/misc/async.mdx @@ -13,7 +13,7 @@ function waitFor( timeout?: number; interval?: number; onTimeout?: (error: Error) => Error; - } + }, ): Promise; ``` @@ -93,7 +93,7 @@ await waitFor( () => { expect(someFunction).toHaveBeenCalledWith(); }, - { timeout: 10000 } + { timeout: 10000 }, ); ``` @@ -116,7 +116,7 @@ function waitForElementToBeRemoved( timeout?: number; interval?: number; onTimeout?: (error: Error) => Error; - } + }, ): Promise; ``` diff --git a/website/docs/14.x/docs/api/misc/render-hook.mdx b/website/docs/14.x/docs/api/misc/render-hook.mdx index ab4104caf..1f527ce10 100644 --- a/website/docs/14.x/docs/api/misc/render-hook.mdx +++ b/website/docs/14.x/docs/api/misc/render-hook.mdx @@ -5,7 +5,7 @@ ```ts async function renderHook( hookFn: (props: Props) => Result, - options?: RenderHookOptions + options?: RenderHookOptions, ): Promise>; ``` diff --git a/website/docs/14.x/docs/api/queries.mdx b/website/docs/14.x/docs/api/queries.mdx index 3b2713703..ccf5075df 100644 --- a/website/docs/14.x/docs/api/queries.mdx +++ b/website/docs/14.x/docs/api/queries.mdx @@ -183,7 +183,7 @@ import { render, screen } from '@testing-library/react-native'; await render( Hello - + , ); const element = screen.getByRole('button'); const element2 = screen.getByRole('button', { name: 'Hello' }); @@ -401,12 +401,14 @@ await render(Hidden from accessibility) expect( screen.queryByText('Hidden from accessibility', { includeHiddenElements: false, - }) + }), ).not.toBeOnTheScreen(); // Include hidden elements expect( - screen.getByText('Hidden from accessibility', { includeHiddenElements: true }) + screen.getByText('Hidden from accessibility', { + includeHiddenElements: true, + }), ).toBeOnTheScreen(); ``` diff --git a/website/docs/14.x/docs/api/render.mdx b/website/docs/14.x/docs/api/render.mdx index 9c674d73f..7feba4842 100644 --- a/website/docs/14.x/docs/api/render.mdx +++ b/website/docs/14.x/docs/api/render.mdx @@ -5,7 +5,7 @@ ```ts async function render( element: React.ReactElement, - options?: RenderOptions + options?: RenderOptions, ): Promise; ``` diff --git a/website/docs/14.x/docs/api/screen.mdx b/website/docs/14.x/docs/api/screen.mdx index 88393e6e1..1d2098294 100644 --- a/website/docs/14.x/docs/api/screen.mdx +++ b/website/docs/14.x/docs/api/screen.mdx @@ -124,7 +124,10 @@ You can also transform prop values so that they are more readable (e.g., flatten import { StyleSheet } from 'react-native'; screen.debug({ - mapProps: ({ style, ...props }) => ({ style: StyleSheet.flatten(style), ...props }), + mapProps: ({ style, ...props }) => ({ + style: StyleSheet.flatten(style), + ...props, + }), }); ``` @@ -186,7 +189,7 @@ test('example', async () => { await render( Hello - + , ); // root is the View element you rendered expect(screen.root.props.testID).toBe('root-view'); diff --git a/website/docs/14.x/docs/guides/common-mistakes.mdx b/website/docs/14.x/docs/guides/common-mistakes.mdx index 7982a956e..d56ada721 100644 --- a/website/docs/14.x/docs/guides/common-mistakes.mdx +++ b/website/docs/14.x/docs/guides/common-mistakes.mdx @@ -34,7 +34,7 @@ test('finds input by label', async () => { await render( - + , ); // ✅ Good - uses accessible label @@ -65,7 +65,7 @@ test('uses role queries', async () => { Submit - + , ); // ✅ Good - uses role query @@ -104,7 +104,7 @@ test('button is disabled', async () => { await render( Submit - + , ); const button = screen.getByRole('button', { name: 'Submit' }); @@ -139,7 +139,7 @@ test('checks non-existence', async () => { await render( Hello - + , ); // ✅ Good - uses queryBy for non-existence check @@ -243,7 +243,7 @@ test('finds element incorrectly', async () => { const { container } = await render( Hello - + , ); // ❌ Bad - using container.queryAll directly @@ -293,7 +293,7 @@ test('renders component', async () => { const { getByText } = await render( Hello - + , ); expect(getByText('Hello')).toBeOnTheScreen(); @@ -310,7 +310,7 @@ test('renders component', async () => { await render( Hello - + , ); expect(screen.getByText('Hello')).toBeOnTheScreen(); @@ -422,7 +422,7 @@ test('finds text correctly', async () => { await render( Hello World - + , ); // ✅ Good - queries by visible text @@ -489,7 +489,7 @@ test('uses getBy as assertion', async () => { await render( Hello - + , ); // ✅ Good - getBy throws if not found, so it's an assertion diff --git a/website/docs/14.x/docs/start/migration-v14.mdx b/website/docs/14.x/docs/start/migration-v14.mdx index f58ad41c9..46acf7891 100644 --- a/website/docs/14.x/docs/start/migration-v14.mdx +++ b/website/docs/14.x/docs/start/migration-v14.mdx @@ -247,7 +247,7 @@ await fireEvent.press(screen.getByText('Press me'), { expect(onPress).toHaveBeenCalledWith( expect.objectContaining({ nativeEvent: expect.objectContaining({ pageX: 20, pageY: 30 }), - }) + }), ); ``` diff --git a/website/rspress.config.ts b/website/rspress.config.ts index 0e20fb78b..278823fea 100644 --- a/website/rspress.config.ts +++ b/website/rspress.config.ts @@ -1,6 +1,6 @@ -import * as path from 'path'; -import { defineConfig } from '@rspress/core'; import { pluginCallstackTheme } from '@callstack/rspress-theme/plugin'; +import { defineConfig } from '@rspress/core'; +import * as path from 'path'; import { pluginOpenGraph } from 'rsbuild-plugin-open-graph'; const __dirname = path.dirname(new URL(import.meta.url).pathname); @@ -31,7 +31,10 @@ const sidebar12x = { { text: 'Miscellaneous', items: [ - { text: 'Accessibility', link: '/12.x/docs/api/misc/accessibility' }, + { + text: 'Accessibility', + link: '/12.x/docs/api/misc/accessibility', + }, { text: 'Async utilities', link: '/12.x/docs/api/misc/async' }, { text: 'Config', link: '/12.x/docs/api/misc/config' }, { text: 'Other', link: '/12.x/docs/api/misc/other' }, @@ -46,14 +49,23 @@ const sidebar12x = { { text: 'How to Query', link: '/12.x/docs/guides/how-to-query' }, { text: 'Troubleshooting', link: '/12.x/docs/guides/troubleshooting' }, { text: 'FAQ', link: '/12.x/docs/guides/faq' }, - { text: 'Community Resources', link: '/12.x/docs/guides/community-resources' }, + { + text: 'Community Resources', + link: '/12.x/docs/guides/community-resources', + }, ], }, { text: 'Advanced Guides', items: [ - { text: 'Testing Environment', link: '/12.x/docs/advanced/testing-env' }, - { text: 'Understanding Act', link: '/12.x/docs/advanced/understanding-act' }, + { + text: 'Testing Environment', + link: '/12.x/docs/advanced/testing-env', + }, + { + text: 'Understanding Act', + link: '/12.x/docs/advanced/understanding-act', + }, ], }, { @@ -86,7 +98,12 @@ const sidebar12x = { }, { text: 'Advanced Recipes', - items: [{ text: 'Network Requests', link: '/12.x/cookbook/advanced/network-requests' }], + items: [ + { + text: 'Network Requests', + link: '/12.x/cookbook/advanced/network-requests', + }, + ], }, { text: 'State Management Recipes', @@ -122,7 +139,10 @@ const sidebar14x = { { text: 'Miscellaneous', items: [ - { text: 'Accessibility', link: '/14.x/docs/api/misc/accessibility' }, + { + text: 'Accessibility', + link: '/14.x/docs/api/misc/accessibility', + }, { text: 'Async utilities', link: '/14.x/docs/api/misc/async' }, { text: 'Config', link: '/14.x/docs/api/misc/config' }, { text: 'Other', link: '/14.x/docs/api/misc/other' }, @@ -139,15 +159,27 @@ const sidebar14x = { { text: 'LLM Guidelines', link: '/14.x/docs/guides/llm-guidelines' }, { text: 'Troubleshooting', link: '/14.x/docs/guides/troubleshooting' }, { text: 'FAQ', link: '/14.x/docs/guides/faq' }, - { text: 'Community Resources', link: '/14.x/docs/guides/community-resources' }, + { + text: 'Community Resources', + link: '/14.x/docs/guides/community-resources', + }, ], }, { text: 'Advanced Guides', items: [ - { text: 'Testing Environment', link: '/14.x/docs/advanced/testing-env' }, - { text: 'Third-party Integration', link: '/14.x/docs/advanced/third-party-integration' }, - { text: 'Understanding Act', link: '/14.x/docs/advanced/understanding-act' }, + { + text: 'Testing Environment', + link: '/14.x/docs/advanced/testing-env', + }, + { + text: 'Third-party Integration', + link: '/14.x/docs/advanced/third-party-integration', + }, + { + text: 'Understanding Act', + link: '/14.x/docs/advanced/understanding-act', + }, ], }, ], @@ -162,7 +194,12 @@ const sidebar14x = { }, { text: 'Advanced Recipes', - items: [{ text: 'Network Requests', link: '/14.x/cookbook/advanced/network-requests' }], + items: [ + { + text: 'Network Requests', + link: '/14.x/cookbook/advanced/network-requests', + }, + ], }, { text: 'State Management Recipes', @@ -216,14 +253,20 @@ const sidebarDefault = { { text: 'React 19', link: '/docs/guides/react-19' }, { text: 'Troubleshooting', link: '/docs/guides/troubleshooting' }, { text: 'FAQ', link: '/docs/guides/faq' }, - { text: 'Community Resources', link: '/docs/guides/community-resources' }, + { + text: 'Community Resources', + link: '/docs/guides/community-resources', + }, ], }, { text: 'Advanced Guides', items: [ { text: 'Testing Environment', link: '/docs/advanced/testing-env' }, - { text: 'Third-party Integration', link: '/docs/advanced/third-party-integration' }, + { + text: 'Third-party Integration', + link: '/docs/advanced/third-party-integration', + }, { text: 'Understanding Act', link: '/docs/advanced/understanding-act' }, ], }, @@ -258,7 +301,12 @@ const sidebarDefault = { }, { text: 'Advanced Recipes', - items: [{ text: 'Network Requests', link: '/cookbook/advanced/network-requests' }], + items: [ + { + text: 'Network Requests', + link: '/cookbook/advanced/network-requests', + }, + ], }, { text: 'State Management Recipes', diff --git a/yarn.lock b/yarn.lock index c982014b3..0e92a49d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2783,6 +2783,139 @@ __metadata: languageName: node linkType: hard +"@oxfmt/binding-android-arm-eabi@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-android-arm-eabi@npm:0.52.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-android-arm64@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-android-arm64@npm:0.52.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-darwin-arm64@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-darwin-arm64@npm:0.52.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-darwin-x64@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-darwin-x64@npm:0.52.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxfmt/binding-freebsd-x64@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-freebsd-x64@npm:0.52.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm-gnueabihf@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-arm-gnueabihf@npm:0.52.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm-musleabihf@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-arm-musleabihf@npm:0.52.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm64-gnu@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-arm64-gnu@npm:0.52.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm64-musl@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-arm64-musl@npm:0.52.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-linux-ppc64-gnu@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-ppc64-gnu@npm:0.52.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-riscv64-gnu@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-riscv64-gnu@npm:0.52.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-riscv64-musl@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-riscv64-musl@npm:0.52.0" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-linux-s390x-gnu@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-s390x-gnu@npm:0.52.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-x64-gnu@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-x64-gnu@npm:0.52.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-x64-musl@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-linux-x64-musl@npm:0.52.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-openharmony-arm64@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-openharmony-arm64@npm:0.52.0" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-arm64-msvc@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-win32-arm64-msvc@npm:0.52.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-ia32-msvc@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-win32-ia32-msvc@npm:0.52.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-x64-msvc@npm:0.52.0": + version: 0.52.0 + resolution: "@oxfmt/binding-win32-x64-msvc@npm:0.52.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@phun-ky/typeof@npm:2.0.3": version: 2.0.3 resolution: "@phun-ky/typeof@npm:2.0.3" @@ -3119,11 +3252,10 @@ __metadata: babel-plugin-module-resolver: "npm:^5.0.3" del-cli: "npm:^7.0.0" eslint: "npm:^10.4.0" - eslint-plugin-simple-import-sort: "npm:^13.0.0" jest: "npm:^30.4.2" jest-matcher-utils: "npm:^30.4.1" + oxfmt: "npm:^0.52.0" picocolors: "npm:^1.1.1" - prettier: "npm:^3.8.3" pretty-format: "npm:^30.4.1" react: "npm:19.2.3" react-native: "npm:0.85.3" @@ -5589,15 +5721,6 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-simple-import-sort@npm:^13.0.0": - version: 13.0.0 - resolution: "eslint-plugin-simple-import-sort@npm:13.0.0" - peerDependencies: - eslint: ">=5.0.0" - checksum: 10c0/f561f3483c1c18dfa2705326d38d62c62d4aeb5947ed6d1f028299c5dc668586b5ef144926e68fe187b3a937ee0159738dcbca8c286fe56f489de52fd8f9e678 - languageName: node - linkType: hard - "eslint-restricted-globals@npm:^0.2.0": version: 0.2.0 resolution: "eslint-restricted-globals@npm:0.2.0" @@ -8774,6 +8897,83 @@ __metadata: languageName: node linkType: hard +"oxfmt@npm:^0.52.0": + version: 0.52.0 + resolution: "oxfmt@npm:0.52.0" + dependencies: + "@oxfmt/binding-android-arm-eabi": "npm:0.52.0" + "@oxfmt/binding-android-arm64": "npm:0.52.0" + "@oxfmt/binding-darwin-arm64": "npm:0.52.0" + "@oxfmt/binding-darwin-x64": "npm:0.52.0" + "@oxfmt/binding-freebsd-x64": "npm:0.52.0" + "@oxfmt/binding-linux-arm-gnueabihf": "npm:0.52.0" + "@oxfmt/binding-linux-arm-musleabihf": "npm:0.52.0" + "@oxfmt/binding-linux-arm64-gnu": "npm:0.52.0" + "@oxfmt/binding-linux-arm64-musl": "npm:0.52.0" + "@oxfmt/binding-linux-ppc64-gnu": "npm:0.52.0" + "@oxfmt/binding-linux-riscv64-gnu": "npm:0.52.0" + "@oxfmt/binding-linux-riscv64-musl": "npm:0.52.0" + "@oxfmt/binding-linux-s390x-gnu": "npm:0.52.0" + "@oxfmt/binding-linux-x64-gnu": "npm:0.52.0" + "@oxfmt/binding-linux-x64-musl": "npm:0.52.0" + "@oxfmt/binding-openharmony-arm64": "npm:0.52.0" + "@oxfmt/binding-win32-arm64-msvc": "npm:0.52.0" + "@oxfmt/binding-win32-ia32-msvc": "npm:0.52.0" + "@oxfmt/binding-win32-x64-msvc": "npm:0.52.0" + tinypool: "npm:2.1.0" + peerDependencies: + svelte: ^5.0.0 + vite-plus: "*" + dependenciesMeta: + "@oxfmt/binding-android-arm-eabi": + optional: true + "@oxfmt/binding-android-arm64": + optional: true + "@oxfmt/binding-darwin-arm64": + optional: true + "@oxfmt/binding-darwin-x64": + optional: true + "@oxfmt/binding-freebsd-x64": + optional: true + "@oxfmt/binding-linux-arm-gnueabihf": + optional: true + "@oxfmt/binding-linux-arm-musleabihf": + optional: true + "@oxfmt/binding-linux-arm64-gnu": + optional: true + "@oxfmt/binding-linux-arm64-musl": + optional: true + "@oxfmt/binding-linux-ppc64-gnu": + optional: true + "@oxfmt/binding-linux-riscv64-gnu": + optional: true + "@oxfmt/binding-linux-riscv64-musl": + optional: true + "@oxfmt/binding-linux-s390x-gnu": + optional: true + "@oxfmt/binding-linux-x64-gnu": + optional: true + "@oxfmt/binding-linux-x64-musl": + optional: true + "@oxfmt/binding-openharmony-arm64": + optional: true + "@oxfmt/binding-win32-arm64-msvc": + optional: true + "@oxfmt/binding-win32-ia32-msvc": + optional: true + "@oxfmt/binding-win32-x64-msvc": + optional: true + peerDependenciesMeta: + svelte: + optional: true + vite-plus: + optional: true + bin: + oxfmt: bin/oxfmt + checksum: 10c0/a67a597202e29432f29049a6862feb927b6f996e5e909cb32acb2fe282d4b6d01d2e693c2b8a0ca6d016f236301cdd66c9250fd13af0876aee6c5b0eddba259f + languageName: node + linkType: hard + "p-limit@npm:^2.0.0, p-limit@npm:^2.2.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" @@ -9080,7 +9280,7 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^3.0.3, prettier@npm:^3.8.3": +"prettier@npm:^3.0.3": version: 3.8.3 resolution: "prettier@npm:3.8.3" bin: @@ -10355,6 +10555,13 @@ __metadata: languageName: node linkType: hard +"tinypool@npm:2.1.0": + version: 2.1.0 + resolution: "tinypool@npm:2.1.0" + checksum: 10c0/9fb1c760558c6264e0f4cfde96a63b12450b43f1730fbe6274aa24ddbdf488745c08924d0dea7a1303b47d555416a6415f2113898c69b6ecf731e75ac95238a5 + languageName: node + linkType: hard + "tmpl@npm:1.0.5": version: 1.0.5 resolution: "tmpl@npm:1.0.5"