diff --git a/libs/util/children.ts b/libs/util/children.ts
index 018319d193..c428c3f8f9 100644
--- a/libs/util/children.ts
+++ b/libs/util/children.ts
@@ -46,9 +46,7 @@ export const flattenChildren = (children: ReactNode): ChildArray => {
const childArray = React.Children.toArray(children)
return childArray.reduce((flattened: ChildArray, child) => {
if ((child as ReactElement)?.type === React.Fragment) {
- return flattened.concat(
- flattenChildren((child as ReactElement).props.children)
- )
+ return flattened.concat(flattenChildren((child as ReactElement).props.children))
}
flattened.push(child)
return flattened
@@ -67,9 +65,7 @@ const matchType =
(
// we have to fallback on some very imperfect string comparisons.
if (process.env.NODE_ENV !== 'production' && typeof child.type !== 'string') {
if (componentType.displayName) {
- return (
- (child.type as ComponentType).displayName === componentType.displayName
- )
+ return (child.type as ComponentType).displayName === componentType.displayName
}
return child.type.toString() === componentType.toString()
}
@@ -96,18 +92,14 @@ const pluck =
(
): React.ReactElement
> | null => {
const childIndex = children.findIndex(selector)
return childIndex !== -1
- ? (children.splice(childIndex, 1)[0] as React.ReactElement<
- P,
- ComponentType
- >)
+ ? (children.splice(childIndex, 1)[0] as React.ReactElement
>)
: null
}
export const pluckFirstOfType =
(
children: ChildArray,
componentType: ComponentType
-) =>
- pluck
(children, (child) => matchType(child as ReactElement, componentType))
+) => pluck
(children, (child) => matchType(child as ReactElement, componentType))
export const pluckAllOfType =
(
children: ChildArray,
@@ -116,9 +108,7 @@ export const pluckAllOfType =
(
const result: React.ReactElement
>[] = []
for (let i = children.length - 1; i >= 0; --i) {
if (matchType(children[i] as ReactElement, componentType)) {
- result.unshift(
- children.splice(i, 1)[0] as React.ReactElement
>
- )
+ result.unshift(children.splice(i, 1)[0] as React.ReactElement
>)
}
}
return result
diff --git a/libs/util/classed.ts b/libs/util/classed.ts
index 8b0331c387..91420cf2dd 100644
--- a/libs/util/classed.ts
+++ b/libs/util/classed.ts
@@ -8,11 +8,7 @@ const make =
// only one argument here means string interpolations are not allowed
(strings: TemplateStringsArray) => {
const Comp = ({ className, children, ...rest }: JSX.IntrinsicElements[T]) =>
- React.createElement(
- tag,
- { className: cn(strings[0], className), ...rest },
- children
- )
+ React.createElement(tag, { className: cn(strings[0], className), ...rest }, children)
// allow arbitrary components to hang off this one, e.g., Table.Body
Comp.displayName = `classed.${tag}`
diff --git a/libs/util/object.ts b/libs/util/object.ts
index d4485e5d03..d626861eda 100644
--- a/libs/util/object.ts
+++ b/libs/util/object.ts
@@ -17,14 +17,11 @@ export const unsafe_get = (obj: any, path: string) => {
type PathImpl = Key extends string
? T[Key] extends Record
?
- | `${Key}.${PathImpl> &
- string}`
+ | `${Key}.${PathImpl> & string}`
| `${Key}.${Exclude & string}`
: never
: never
type PathImpl2 = PathImpl | keyof T
-export type Path = PathImpl2 extends string | keyof T
- ? PathImpl2
- : keyof T
+export type Path = PathImpl2 extends string | keyof T ? PathImpl2 : keyof T
diff --git a/libs/util/str.ts b/libs/util/str.ts
index 5573cc5891..3d64829b1f 100644
--- a/libs/util/str.ts
+++ b/libs/util/str.ts
@@ -1,8 +1,6 @@
-export const capitalize = (s: string) =>
- s && s.charAt(0).toUpperCase() + s.slice(1)
+export const capitalize = (s: string) => s && s.charAt(0).toUpperCase() + s.slice(1)
-export const pluralize = (s: string, n: number) =>
- `${n} ${s}${n === 1 ? '' : 's'}`
+export const pluralize = (s: string, n: number) => `${n} ${s}${n === 1 ? '' : 's'}`
export const camelCase = (s: string) =>
s
diff --git a/libs/util/wrap.tsx b/libs/util/wrap.tsx
index 06e1178070..6f338b4179 100644
--- a/libs/util/wrap.tsx
+++ b/libs/util/wrap.tsx
@@ -8,8 +8,4 @@ interface WrapProps {
}
export const Wrap = (props: WrapProps) =>
- props.when ? (
- React.cloneElement(props.with, [], props.children)
- ) : (
- <>{props.children}>
- )
+ props.when ? React.cloneElement(props.with, [], props.children) : <>{props.children}>
diff --git a/plopfile.js b/plopfile.js
index 1830dfa86d..7ce13f2f91 100644
--- a/plopfile.js
+++ b/plopfile.js
@@ -31,8 +31,7 @@ module.exports = (plop) => {
validate: (input) => {
if (/[a-z]/.test(input[0])) return 'Use SentenceCasing'
if (input.includes(' ')) return "Whitespace isn't allowed"
- if (input.includes('-'))
- return '`-` unspported, prefer SentenceCasing'
+ if (input.includes('-')) return '`-` unspported, prefer SentenceCasing'
return true
},
},
diff --git a/tools/convert-tokens.ts b/tools/convert-tokens.ts
index e21158b6fb..b4714ea43a 100644
--- a/tools/convert-tokens.ts
+++ b/tools/convert-tokens.ts
@@ -24,18 +24,12 @@ const hexToRGB = (hexColor: string) => {
const percentToRem = (value: string) => {
return parseFloat(value) / 100 + 'rem'
}
-const pxToRem = (value: string | number) =>
- parseFloat(value as string) / 16 + 'rem'
+const pxToRem = (value: string | number) => parseFloat(value as string) / 16 + 'rem'
const valueToRem = (value: string | number) =>
- typeof value === 'string' && value.includes('%')
- ? percentToRem(value)
- : pxToRem(value)
+ typeof value === 'string' && value.includes('%') ? percentToRem(value) : pxToRem(value)
const formatFontClass = (name: string) => {
- return name
- .replace('-light', '')
- .replace('-regular', '')
- .replace('-book', '-semi')
+ return name.replace('-light', '').replace('-regular', '').replace('-book', '-semi')
}
/**
@@ -85,9 +79,7 @@ StyleDictionary.registerFormat({
${options.selector} {
${dictionary.allProperties
- .filter(
- (prop) => typeof prop.value !== 'object' && prop.type === 'color'
- )
+ .filter((prop) => typeof prop.value !== 'object' && prop.type === 'color')
.sort(({ name }) => (name.startsWith('base-') ? -1 : 1))
.map((prop) => {
const color: string = prop.value.slice(1, 7)
@@ -153,9 +145,7 @@ const makeColorUtility = (
classPrefix: string,
cssProperties: CSSProperty | CSSProperty[]
) => {
- const properties = Array.isArray(cssProperties)
- ? cssProperties
- : [cssProperties]
+ const properties = Array.isArray(cssProperties) ? cssProperties : [cssProperties]
return (colors: TransformedToken[]) =>
colors
.filter((color) => color.name.startsWith(tokenPrefix))
@@ -164,10 +154,7 @@ const makeColorUtility = (
'${
(color.original.description &&
// FIXME: Remove replace once https://github.com/tailwindlabs/tailwindcss/issues/7420 is fixed
- `/* ${color.original.description.trim()} */ \\n`.replace(
- /,/g,
- ';'
- )) ||
+ `/* ${color.original.description.trim()} */ \\n`.replace(/,/g, ';')) ||
''
}.${color.name.replace(tokenPrefix, classPrefix)}': {
${properties.map((prop) => `'${prop}': 'var(--${color.name})'`)}
@@ -178,9 +165,7 @@ const makeColorUtility = (
StyleDictionary.registerFormat({
name: 'tailwind',
formatter({ dictionary }) {
- const typeStyles = dictionary.allProperties.filter(
- (prop) => prop.type === 'typography'
- )
+ const typeStyles = dictionary.allProperties.filter((prop) => prop.type === 'typography')
const colors = dictionary.allProperties.filter(
(prop) => prop.type === 'color' && !prop.name.startsWith('base')
)
@@ -232,9 +217,7 @@ StyleDictionary.registerFormat({
${borderRadius
.map(
({ name }) =>
- `'${
- name.replace(/border-radius-?/, '') || 'DEFAULT'
- }': 'var(--${name})'`
+ `'${name.replace(/border-radius-?/, '') || 'DEFAULT'}': 'var(--${name})'`
)
.join(',')}
}
@@ -250,9 +233,7 @@ StyleDictionary.registerFormat({
const colors = dictionary.allProperties
.filter((prop) => prop.type === 'color')
.sort(({ name }) => (name.startsWith('base-') ? -1 : 1))
- const baseColors = colors
- .filter(({ name }) => name.startsWith('base-'))
- .reverse()
+ const baseColors = colors.filter(({ name }) => name.startsWith('base-')).reverse()
const colorGroups = colors.reduce((all, current) => {
const currentGroup = all[current.value] ?? []
currentGroup.push(current)
@@ -275,8 +256,7 @@ StyleDictionary.registerFormat({
.map(
(color) =>
` ${color.name} --> ${
- color.attributes?.ref ??
- `${color.original.rawValue}:::${groupColor.name}`
+ color.attributes?.ref ?? `${color.original.rawValue}:::${groupColor.name}`
}`
)
.join('\n')}
@@ -328,10 +308,7 @@ StyleDictionary.registerTransform({
name: 'name/size-convert',
type: 'name',
transformer(token) {
- return token.name
- .replace('large', 'lg')
- .replace('small', 'sm')
- .replace('medium', 'md')
+ return token.name.replace('large', 'lg').replace('small', 'sm').replace('medium', 'md')
},
})
@@ -340,9 +317,7 @@ StyleDictionary.registerTransform({
type: 'attribute',
matcher: (token) => token.original.type === 'color',
transformer(token) {
- const ref = token.original.rawValue
- .match(/{(.+)}/)?.[1]
- ?.replace(/\./g, '-')
+ const ref = token.original.rawValue.match(/{(.+)}/)?.[1]?.replace(/\./g, '-')
return { ...token.attributes, ref }
},
})
diff --git a/types/react-table.d.ts b/types/react-table.d.ts
index 79a93fbf1e..0cf8072b5c 100644
--- a/types/react-table.d.ts
+++ b/types/react-table.d.ts
@@ -12,9 +12,8 @@ declare module 'react-table' {
D extends Record = Record
> extends UseRowSelectInstanceProps {}
- export interface Row<
- D extends Record = Record
- > extends UseRowSelectRowProps {}
+ export interface Row = Record>
+ extends UseRowSelectRowProps {}
export interface HeaderGroup {
className?: string
diff --git a/vite.config.ts b/vite.config.ts
index 862191197a..e247c988b8 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -34,9 +34,7 @@ export default defineConfig(({ mode }) => ({
react({
babel: {
plugins:
- mode === 'development'
- ? ['./libs/babel-transform-react-display-name']
- : [],
+ mode === 'development' ? ['./libs/babel-transform-react-display-name'] : [],
},
}),
],