Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Update prettier config #5249

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions examples/react/basic/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,31 @@ const columnHelper = createColumnHelper<Person>()

const columns = [
columnHelper.accessor('firstName', {
cell: info => info.getValue(),
footer: info => info.column.id,
cell: (info) => info.getValue(),
footer: (info) => info.column.id,
}),
columnHelper.accessor(row => row.lastName, {
columnHelper.accessor((row) => row.lastName, {
id: 'lastName',
cell: info => <i>{info.getValue()}</i>,
cell: (info) => <i>{info.getValue()}</i>,
header: () => <span>Last Name</span>,
footer: info => info.column.id,
footer: (info) => info.column.id,
}),
columnHelper.accessor('age', {
header: () => 'Age',
cell: info => info.renderValue(),
footer: info => info.column.id,
cell: (info) => info.renderValue(),
footer: (info) => info.column.id,
}),
columnHelper.accessor('visits', {
header: () => <span>Visits</span>,
footer: info => info.column.id,
footer: (info) => info.column.id,
}),
columnHelper.accessor('status', {
header: 'Status',
footer: info => info.column.id,
footer: (info) => info.column.id,
}),
columnHelper.accessor('progress', {
header: 'Profile Progress',
footer: info => info.column.id,
footer: (info) => info.column.id,
}),
]

Expand All @@ -92,25 +92,25 @@ function App() {
<div className="p-2">
<table>
<thead>
{table.getHeaderGroups().map(headerGroup => (
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}>
{headerGroup.headers.map(header => (
{headerGroup.headers.map((header) => (
<th key={header.id}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext()
header.getContext(),
)}
</th>
))}
</tr>
))}
</thead>
<tbody>
{table.getRowModel().rows.map(row => (
{table.getRowModel().rows.map((row) => (
<tr key={row.id}>
{row.getVisibleCells().map(cell => (
{row.getVisibleCells().map((cell) => (
<td key={cell.id}>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</td>
Expand All @@ -119,15 +119,15 @@ function App() {
))}
</tbody>
<tfoot>
{table.getFooterGroups().map(footerGroup => (
{table.getFooterGroups().map((footerGroup) => (
<tr key={footerGroup.id}>
{footerGroup.headers.map(header => (
{footerGroup.headers.map((header) => (
<th key={header.id}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.footer,
header.getContext()
header.getContext(),
)}
</th>
))}
Expand All @@ -149,5 +149,5 @@ if (!rootElement) throw new Error('Failed to find the root element')
ReactDOM.createRoot(rootElement).render(
<React.StrictMode>
<App />
</React.StrictMode>
</React.StrictMode>,
)
40 changes: 20 additions & 20 deletions examples/react/bootstrap/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,48 @@ import { makeData, Person } from './makeData'
const columns: ColumnDef<Person>[] = [
{
header: 'Name',
footer: props => props.column.id,
footer: (props) => props.column.id,
columns: [
{
accessorKey: 'firstName',
cell: info => info.getValue(),
footer: props => props.column.id,
cell: (info) => info.getValue(),
footer: (props) => props.column.id,
},
{
accessorFn: row => row.lastName,
accessorFn: (row) => row.lastName,
id: 'lastName',
cell: info => info.getValue(),
cell: (info) => info.getValue(),
header: () => <span>Last Name</span>,
footer: props => props.column.id,
footer: (props) => props.column.id,
},
],
},
{
header: 'Info',
footer: props => props.column.id,
footer: (props) => props.column.id,
columns: [
{
accessorKey: 'age',
header: () => 'Age',
footer: props => props.column.id,
footer: (props) => props.column.id,
},
{
header: 'More Info',
columns: [
{
accessorKey: 'visits',
header: () => <span>Visits</span>,
footer: props => props.column.id,
footer: (props) => props.column.id,
},
{
accessorKey: 'status',
header: 'Status',
footer: props => props.column.id,
footer: (props) => props.column.id,
},
{
accessorKey: 'progress',
header: 'Profile Progress',
footer: props => props.column.id,
footer: (props) => props.column.id,
},
],
},
Expand All @@ -79,25 +79,25 @@ function App() {
<div className="p-2">
<BTable striped bordered hover responsive size="sm">
<thead>
{table.getHeaderGroups().map(headerGroup => (
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}>
{headerGroup.headers.map(header => (
{headerGroup.headers.map((header) => (
<th key={header.id} colSpan={header.colSpan}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.header,
header.getContext()
header.getContext(),
)}
</th>
))}
</tr>
))}
</thead>
<tbody>
{table.getRowModel().rows.map(row => (
{table.getRowModel().rows.map((row) => (
<tr key={row.id}>
{row.getVisibleCells().map(cell => (
{row.getVisibleCells().map((cell) => (
<td key={cell.id}>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</td>
Expand All @@ -106,15 +106,15 @@ function App() {
))}
</tbody>
<tfoot>
{table.getFooterGroups().map(footerGroup => (
{table.getFooterGroups().map((footerGroup) => (
<tr key={footerGroup.id}>
{footerGroup.headers.map(header => (
{footerGroup.headers.map((header) => (
<th key={header.id} colSpan={header.colSpan}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.footer,
header.getContext()
header.getContext(),
)}
</th>
))}
Expand All @@ -137,5 +137,5 @@ if (!rootElement) throw new Error('Failed to find the root element')
ReactDOM.createRoot(rootElement).render(
<React.StrictMode>
<App />
</React.StrictMode>
</React.StrictMode>,
)
46 changes: 23 additions & 23 deletions examples/react/column-dnd/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,52 +23,52 @@ const defaultColumns: ColumnDef<Person>[] = [
accessorKey: 'firstName',
id: 'firstName',
header: 'First Name',
cell: info => info.getValue(),
footer: props => props.column.id,
cell: (info) => info.getValue(),
footer: (props) => props.column.id,
},
{
accessorFn: row => row.lastName,
accessorFn: (row) => row.lastName,
id: 'lastName',
cell: info => info.getValue(),
cell: (info) => info.getValue(),
header: () => <span>Last Name</span>,
footer: props => props.column.id,
footer: (props) => props.column.id,
},
{
accessorKey: 'age',
id: 'age',
header: 'Age',
footer: props => props.column.id,
footer: (props) => props.column.id,
},

{
accessorKey: 'visits',
id: 'visits',
header: 'Visits',
footer: props => props.column.id,
footer: (props) => props.column.id,
},
{
accessorKey: 'status',
id: 'status',
header: 'Status',
footer: props => props.column.id,
footer: (props) => props.column.id,
},
{
accessorKey: 'progress',
id: 'progress',
header: 'Profile Progress',
footer: props => props.column.id,
footer: (props) => props.column.id,
},
]

const reorderColumn = (
draggedColumnId: string,
targetColumnId: string,
columnOrder: string[]
columnOrder: string[],
): ColumnOrderState => {
columnOrder.splice(
columnOrder.indexOf(targetColumnId),
0,
columnOrder.splice(columnOrder.indexOf(draggedColumnId), 1)[0] as string
columnOrder.splice(columnOrder.indexOf(draggedColumnId), 1)[0] as string,
)
return [...columnOrder]
}
Expand All @@ -87,14 +87,14 @@ const DraggableColumnHeader: FC<{
const newColumnOrder = reorderColumn(
draggedColumn.id,
column.id,
columnOrder
columnOrder,
)
setColumnOrder(newColumnOrder)
},
})

const [{ isDragging }, dragRef, previewRef] = useDrag({
collect: monitor => ({
collect: (monitor) => ({
isDragging: monitor.isDragging(),
}),
item: () => column,
Expand Down Expand Up @@ -122,13 +122,13 @@ function App() {
const [columns] = React.useState(() => [...defaultColumns])

const [columnOrder, setColumnOrder] = React.useState<ColumnOrderState>(
columns.map(column => column.id as string) //must start out with populated columnOrder so we can splice
columns.map((column) => column.id as string), //must start out with populated columnOrder so we can splice
)

const regenerateData = () => setData(() => makeData(20))

const resetOrder = () =>
setColumnOrder(columns.map(column => column.id as string))
setColumnOrder(columns.map((column) => column.id as string))

const table = useReactTable({
data,
Expand Down Expand Up @@ -157,9 +157,9 @@ function App() {
<div className="h-4" />
<table>
<thead>
{table.getHeaderGroups().map(headerGroup => (
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}>
{headerGroup.headers.map(header => (
{headerGroup.headers.map((header) => (
<DraggableColumnHeader
key={header.id}
header={header}
Expand All @@ -170,9 +170,9 @@ function App() {
))}
</thead>
<tbody>
{table.getRowModel().rows.map(row => (
{table.getRowModel().rows.map((row) => (
<tr key={row.id}>
{row.getVisibleCells().map(cell => (
{row.getVisibleCells().map((cell) => (
<td key={cell.id}>
{flexRender(cell.column.columnDef.cell, cell.getContext())}
</td>
Expand All @@ -181,15 +181,15 @@ function App() {
))}
</tbody>
<tfoot>
{table.getFooterGroups().map(footerGroup => (
{table.getFooterGroups().map((footerGroup) => (
<tr key={footerGroup.id}>
{footerGroup.headers.map(header => (
{footerGroup.headers.map((header) => (
<th key={header.id} colSpan={header.colSpan}>
{header.isPlaceholder
? null
: flexRender(
header.column.columnDef.footer,
header.getContext()
header.getContext(),
)}
</th>
))}
Expand All @@ -209,6 +209,6 @@ ReactDOM.createRoot(rootElement).render(
// <React.StrictMode> //disabled for react-dnd preview bug for now
<DndProvider backend={HTML5Backend}>
<App />
</DndProvider>
</DndProvider>,
// </React.StrictMode>
)
Loading