diff --git a/apps/demo/src/main.tsx b/apps/demo/src/main.tsx index 4c9bbe8..5a371dc 100644 --- a/apps/demo/src/main.tsx +++ b/apps/demo/src/main.tsx @@ -6,5 +6,5 @@ import { App } from "./App"; ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - + , ); diff --git a/packages/react/src/components/Button/index.spec.tsx b/packages/react/src/components/Button/index.spec.tsx index 7b07d0f..42b93fb 100644 --- a/packages/react/src/components/Button/index.spec.tsx +++ b/packages/react/src/components/Button/index.spec.tsx @@ -33,7 +33,7 @@ describe(" + , ); const button = screen.getByText("Test button"); const classes = Array.from(button.classList); @@ -57,7 +57,7 @@ describe(" + , ); const button = screen.getByRole("button", { name: "Test button" }); expect(handleClick).not.toBeCalled(); diff --git a/packages/react/src/components/Button/index.tsx b/packages/react/src/components/Button/index.tsx index ecb6cb5..4c946bb 100644 --- a/packages/react/src/components/Button/index.tsx +++ b/packages/react/src/components/Button/index.tsx @@ -22,7 +22,7 @@ export const Button = forwardRef( fullWidth, ...props }, - ref + ref, ) => { const classes = [ "c__button", @@ -49,5 +49,5 @@ export const Button = forwardRef( {!!icon && iconPosition === "right" && icon} ); - } + }, ); diff --git a/packages/react/src/components/DataGrid/DataList.spec.tsx b/packages/react/src/components/DataGrid/DataList.spec.tsx index 4ba5e2d..009e41b 100644 --- a/packages/react/src/components/DataGrid/DataList.spec.tsx +++ b/packages/react/src/components/DataGrid/DataList.spec.tsx @@ -19,7 +19,7 @@ describe("", () => { columns={[{ field: "firstName" }, { field: "lastName" }]} rows={rows} /> - + , ); const table = screen.getByRole("table"); diff --git a/packages/react/src/components/DataGrid/SimpleDataGrid.spec.tsx b/packages/react/src/components/DataGrid/SimpleDataGrid.spec.tsx index 45959a7..8b6292b 100644 --- a/packages/react/src/components/DataGrid/SimpleDataGrid.spec.tsx +++ b/packages/react/src/components/DataGrid/SimpleDataGrid.spec.tsx @@ -42,7 +42,7 @@ describe("", () => { ]} rows={rows} /> - + , ); const table = screen.getByRole("table"); @@ -106,7 +106,7 @@ describe("", () => { }, ]} /> - + , ); // Verify first page rows. @@ -309,7 +309,7 @@ describe("", () => { }, ]} /> - + , ); // Verify first page rows are sorted by firstName ASC. @@ -461,7 +461,7 @@ describe("", () => { }, ]} /> - + , ); // Make sure the sort is enabled on the first name column. @@ -506,7 +506,7 @@ describe("", () => { ]} rows={rows} /> - + , ); screen.getByRole("img", { name: /illustration of an empty table/i }); @@ -526,12 +526,12 @@ describe("", () => { rows={rows} isLoading={true} /> - + , ); // Verify that the empty state is not rendered. expect( - screen.queryByRole("img", { name: /illustration of an empty table/i }) + screen.queryByRole("img", { name: /illustration of an empty table/i }), ).toBeNull(); expect(screen.queryByText(/this table is empty/i)).toBeNull(); diff --git a/packages/react/src/components/DataGrid/SimpleDataGrid.tsx b/packages/react/src/components/DataGrid/SimpleDataGrid.tsx index abdca80..0c6532d 100644 --- a/packages/react/src/components/DataGrid/SimpleDataGrid.tsx +++ b/packages/react/src/components/DataGrid/SimpleDataGrid.tsx @@ -52,8 +52,8 @@ export const SimpleDataGrid = ({ setRealRows( sortedRows.slice( (pagination.page - 1) * pagination.pageSize, - pagination.page * pagination.pageSize - ) + pagination.page * pagination.pageSize, + ), ); } else { setRealRows(sortedRows); diff --git a/packages/react/src/components/DataGrid/index.spec.tsx b/packages/react/src/components/DataGrid/index.spec.tsx index 4d56601..467915e 100644 --- a/packages/react/src/components/DataGrid/index.spec.tsx +++ b/packages/react/src/components/DataGrid/index.spec.tsx @@ -97,7 +97,7 @@ describe("", () => { fetchMock.mockIf( "https://example.com/?page=1&sort=lastName&sortOrder=desc", - () => deferred.promise + () => deferred.promise, ); render(); @@ -115,8 +115,8 @@ describe("", () => { JSON.stringify({ rows: database.slice(0, 10), count: database.length, - }) - ) + }), + ), ); // Make sure the loader disappears. @@ -124,8 +124,8 @@ describe("", () => { expect( screen.queryByRole("status", { name: "Loading data", - }) - ).toBeNull() + }), + ).toBeNull(), ); // Make sure the rows are rendered. @@ -154,7 +154,7 @@ describe("", () => { deferred = new Deferred(); fetchMock.mockIf( "https://example.com/?page=2&sort=lastName&sortOrder=desc", - () => deferred.promise + () => deferred.promise, ); // Go to page 2. @@ -187,8 +187,8 @@ describe("", () => { JSON.stringify({ rows: database.slice(10, 20), count: database.length, - }) - ) + }), + ), ); // Make sure the loader disappears. @@ -196,8 +196,8 @@ describe("", () => { expect( screen.queryByRole("status", { name: "Loading data", - }) - ).toBeNull() + }), + ).toBeNull(), ); // Make sure the rows are rendered. @@ -330,15 +330,15 @@ describe("", () => { expect(tds.length).toBe(3); expect(tds[0].textContent).toEqual(row.firstName); expect(Array.from(tds[0].classList)).toContain( - "c__datagrid__row__cell--highlight" + "c__datagrid__row__cell--highlight", ); expect(tds[1].textContent).toEqual(row.lastName); expect(Array.from(tds[1].classList)).not.toContain( - "c__datagrid__row__cell--highlight" + "c__datagrid__row__cell--highlight", ); expect(tds[2].textContent).toEqual(row.email); expect(Array.from(tds[2].classList)).toContain( - "c__datagrid__row__cell--highlight" + "c__datagrid__row__cell--highlight", ); }); }); diff --git a/packages/react/src/components/DataGrid/index.stories.tsx b/packages/react/src/components/DataGrid/index.stories.tsx index 59b6925..18e8c09 100644 --- a/packages/react/src/components/DataGrid/index.stories.tsx +++ b/packages/react/src/components/DataGrid/index.stories.tsx @@ -58,7 +58,7 @@ export const ClientSideWithoutPagination = () => { email: faker.internet.email(), address: faker.location.streetAddress(), })), - [] + [], ); return ( @@ -110,7 +110,7 @@ export const ClientSideWithPagination = () => { year: faker.date.past().getFullYear(), price: +faker.commerce.price({ min: 5000, max: 5005 }), })), - [] + [], ); const [rowSelection, setRowSelection] = useState({}); @@ -163,7 +163,7 @@ export const FullServerSide = () => { email: faker.internet.email(), address: faker.location.streetAddress(), })), - [] + [], ); const [rowSelection, setRowSelection] = useState({}); const [isLoading, setIsLoading] = useState(true); @@ -194,14 +194,14 @@ export const FullServerSide = () => { setTimeout(() => { // Set the pagination length. pagination.setPagesCount( - Math.ceil(sortedDatabase.length / pagination.pageSize) + Math.ceil(sortedDatabase.length / pagination.pageSize), ); // Select the rows to display on the current page. setRows( sortedDatabase.slice( (pagination.page - 1) * pagination.pageSize, - pagination.page * pagination.pageSize - ) + pagination.page * pagination.pageSize, + ), ); setIsLoading(false); }, 1000); @@ -261,7 +261,7 @@ export const DataListOnly = () => { title: faker.word.sample(), date: faker.date.past({ years: 1 }).toISOString(), })), - [] + [], ); return ( diff --git a/packages/react/src/components/DataGrid/index.tsx b/packages/react/src/components/DataGrid/index.tsx index a6a427c..04882a3 100644 --- a/packages/react/src/components/DataGrid/index.tsx +++ b/packages/react/src/components/DataGrid/index.tsx @@ -84,11 +84,11 @@ export const DataGrid = ({ */ const paginationState = useMemo( () => paginationToPaginationState(pagination), - [pagination] + [pagination], ); const headlessSorting = useMemo( () => sortModelToSortingState(sortModel), - [sortModel] + [sortModel], ); /** @@ -110,7 +110,7 @@ export const DataGrid = ({ // a TS error. if (typeof newHeadlessSorting === "function") { onSortModelChange?.( - sortingStateToSortModel(newHeadlessSorting(headlessSorting)) + sortingStateToSortModel(newHeadlessSorting(headlessSorting)), ); } }, @@ -183,7 +183,7 @@ export const DataGrid = ({ > {flexRender( header.column.columnDef.header, - header.getContext() + header.getContext(), )} {header.column.getIsSorted() === "asc" && ( @@ -226,7 +226,7 @@ export const DataGrid = ({ > {flexRender( cell.column.columnDef.cell, - cell.getContext() + cell.getContext(), )} ); diff --git a/packages/react/src/components/DataGrid/utils.tsx b/packages/react/src/components/DataGrid/utils.tsx index 0827e26..48a6276 100644 --- a/packages/react/src/components/DataGrid/utils.tsx +++ b/packages/react/src/components/DataGrid/utils.tsx @@ -92,7 +92,7 @@ export const sortingStateToSortModel = (sorting: SortingState): SortModel => { }; export const paginationToPaginationState = ( - pagination?: PaginationProps + pagination?: PaginationProps, ): PaginationState | undefined => { if (!pagination) { return undefined; diff --git a/packages/react/src/components/Forms/Checkbox/index.spec.tsx b/packages/react/src/components/Forms/Checkbox/index.spec.tsx index f811d5a..2bbffae 100644 --- a/packages/react/src/components/Forms/Checkbox/index.spec.tsx +++ b/packages/react/src/components/Forms/Checkbox/index.spec.tsx @@ -48,14 +48,14 @@ describe("", () => { render(); expect(screen.getByText("Success text")).toBeInTheDocument(); expect( - document.querySelector(".c__field.c__field--success") + document.querySelector(".c__field.c__field--success"), ).toBeInTheDocument(); }); it("renders with state=error", async () => { render(); expect(screen.getByText("Error text")).toBeInTheDocument(); expect( - document.querySelector(".c__field.c__field--error") + document.querySelector(".c__field.c__field--error"), ).toBeInTheDocument(); }); @@ -64,7 +64,7 @@ describe("", () => { - + , ); screen.getByRole("checkbox", { name: "Agree", @@ -78,7 +78,7 @@ describe("", () => { - + , ); expect(screen.getByText("Text")).toBeInTheDocument(); }); @@ -87,11 +87,11 @@ describe("", () => { - + , ); expect(screen.getByText("Success text")).toBeInTheDocument(); expect( - document.querySelector(".c__checkbox__group.c__field.c__field--success") + document.querySelector(".c__checkbox__group.c__field.c__field--success"), ).toBeInTheDocument(); }); it("renders with group state=error", async () => { @@ -99,11 +99,11 @@ describe("", () => { - + , ); expect(screen.getByText("Error text")).toBeInTheDocument(); expect( - document.querySelector(".c__checkbox__group.c__field.c__field--error") + document.querySelector(".c__checkbox__group.c__field.c__field--error"), ).toBeInTheDocument(); }); }); diff --git a/packages/react/src/components/Forms/DatePicker/Calendar.tsx b/packages/react/src/components/Forms/DatePicker/Calendar.tsx index f34fda7..b69391b 100644 --- a/packages/react/src/components/Forms/DatePicker/Calendar.tsx +++ b/packages/react/src/components/Forms/DatePicker/Calendar.tsx @@ -100,7 +100,7 @@ const CalendarAux = forwardRef( nextButtonProps, calendarProps, }: CalendarAuxProps, - ref: Ref + ref: Ref, ) => { const { t } = useCunningham(); @@ -118,7 +118,7 @@ const CalendarAux = forwardRef( const monthItems: Array