diff --git a/.github/publish-ci/cra4/package.json b/.github/publish-ci/cra4/package.json index 3fd4dd8239..f7d7b1e192 100644 --- a/.github/publish-ci/cra4/package.json +++ b/.github/publish-ci/cra4/package.json @@ -42,7 +42,7 @@ "@types/node": "^20.10.4", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", - "prettier": "^2.8.4", + "prettier": "^3.1.1", "serve": "^14.2.0", "typescript": "^4.9.4" } diff --git a/.github/publish-ci/cra4/yarn.lock b/.github/publish-ci/cra4/yarn.lock index c36e800dd6..c19c1c1c1a 100644 --- a/.github/publish-ci/cra4/yarn.lock +++ b/.github/publish-ci/cra4/yarn.lock @@ -12091,12 +12091,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.8.4": - version: 2.8.4 - resolution: "prettier@npm:2.8.4" +"prettier@npm:^3.1.1": + version: 3.1.1 + resolution: "prettier@npm:3.1.1" bin: - prettier: bin-prettier.js - checksum: c173064bf3df57b6d93d19aa98753b9b9dd7657212e33b41ada8e2e9f9884066bb9ca0b4005b89b3ab137efffdf8fbe0b462785aba20364798ff4303aadda57e + prettier: bin/prettier.cjs + checksum: e386855e3a1af86a748e16953f168be555ce66d6233f4ba54eb6449b88eb0c6b2ca79441b11eae6d28a7f9a5c96440ce50864b9d5f6356d331d39d6bb66c648e languageName: node linkType: hard @@ -13142,7 +13142,7 @@ __metadata: "@types/node": ^20.10.4 "@types/react": ^18.0.26 "@types/react-dom": ^18.0.10 - prettier: ^2.8.4 + prettier: ^3.1.1 react: ^18.2.0 react-dom: ^18.2.0 react-scripts: ^4 diff --git a/.github/publish-ci/cra5/package.json b/.github/publish-ci/cra5/package.json index 6111b072ad..5df3dbb2c7 100644 --- a/.github/publish-ci/cra5/package.json +++ b/.github/publish-ci/cra5/package.json @@ -43,7 +43,7 @@ "@types/node": "^20.10.4", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", - "prettier": "^2.8.4", + "prettier": "^3.1.1", "typescript": "^4.9.4" } } diff --git a/.github/publish-ci/cra5/yarn.lock b/.github/publish-ci/cra5/yarn.lock index 0f30d0a313..ae8a2f83eb 100644 --- a/.github/publish-ci/cra5/yarn.lock +++ b/.github/publish-ci/cra5/yarn.lock @@ -10197,12 +10197,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.8.4": - version: 2.8.4 - resolution: "prettier@npm:2.8.4" +"prettier@npm:^3.1.1": + version: 3.1.1 + resolution: "prettier@npm:3.1.1" bin: - prettier: bin-prettier.js - checksum: c173064bf3df57b6d93d19aa98753b9b9dd7657212e33b41ada8e2e9f9884066bb9ca0b4005b89b3ab137efffdf8fbe0b462785aba20364798ff4303aadda57e + prettier: bin/prettier.cjs + checksum: e386855e3a1af86a748e16953f168be555ce66d6233f4ba54eb6449b88eb0c6b2ca79441b11eae6d28a7f9a5c96440ce50864b9d5f6356d331d39d6bb66c648e languageName: node linkType: hard @@ -10926,7 +10926,7 @@ __metadata: "@types/node": ^20.10.4 "@types/react": ^18.0.26 "@types/react-dom": ^18.0.10 - prettier: ^2.8.4 + prettier: ^3.1.1 react: ^18.2.0 react-dom: ^18.2.0 react-scripts: 5 diff --git a/.github/publish-ci/next/package.json b/.github/publish-ci/next/package.json index 3a39609e00..0a8c214831 100644 --- a/.github/publish-ci/next/package.json +++ b/.github/publish-ci/next/package.json @@ -17,7 +17,7 @@ "@types/node": "^20.10.4", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", - "prettier": "^2.8.4", + "prettier": "^3.1.1", "typescript": "^4.9.4" }, "msw": { diff --git a/.github/publish-ci/next/yarn.lock b/.github/publish-ci/next/yarn.lock index 3237624933..1de9653ce5 100644 --- a/.github/publish-ci/next/yarn.lock +++ b/.github/publish-ci/next/yarn.lock @@ -350,12 +350,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.8.4": - version: 2.8.4 - resolution: "prettier@npm:2.8.4" +"prettier@npm:^3.1.1": + version: 3.1.1 + resolution: "prettier@npm:3.1.1" bin: - prettier: bin-prettier.js - checksum: c173064bf3df57b6d93d19aa98753b9b9dd7657212e33b41ada8e2e9f9884066bb9ca0b4005b89b3ab137efffdf8fbe0b462785aba20364798ff4303aadda57e + prettier: bin/prettier.cjs + checksum: e386855e3a1af86a748e16953f168be555ce66d6233f4ba54eb6449b88eb0c6b2ca79441b11eae6d28a7f9a5c96440ce50864b9d5f6356d331d39d6bb66c648e languageName: node linkType: hard @@ -389,7 +389,7 @@ __metadata: "@types/react": ^18.0.26 "@types/react-dom": ^18.0.10 next: ^13.2 - prettier: ^2.8.4 + prettier: ^3.1.1 react: ^18.2.0 react-dom: ^18.2.0 typescript: ^4.9.4 diff --git a/.github/publish-ci/vite/package.json b/.github/publish-ci/vite/package.json index f1a3411f40..d8a2d24de1 100644 --- a/.github/publish-ci/vite/package.json +++ b/.github/publish-ci/vite/package.json @@ -20,7 +20,7 @@ "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", "@vitejs/plugin-react": "^4.1.0", - "prettier": "^2.8.4", + "prettier": "^3.1.1", "typescript": "^4.9.4", "vite": "^4.0.0" }, diff --git a/.github/publish-ci/vite/yarn.lock b/.github/publish-ci/vite/yarn.lock index 90675a9bb0..ebb6e8dd49 100644 --- a/.github/publish-ci/vite/yarn.lock +++ b/.github/publish-ci/vite/yarn.lock @@ -1619,12 +1619,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.8.4": - version: 2.8.4 - resolution: "prettier@npm:2.8.4" +"prettier@npm:^3.1.1": + version: 3.1.1 + resolution: "prettier@npm:3.1.1" bin: - prettier: bin-prettier.js - checksum: c173064bf3df57b6d93d19aa98753b9b9dd7657212e33b41ada8e2e9f9884066bb9ca0b4005b89b3ab137efffdf8fbe0b462785aba20364798ff4303aadda57e + prettier: bin/prettier.cjs + checksum: e386855e3a1af86a748e16953f168be555ce66d6233f4ba54eb6449b88eb0c6b2ca79441b11eae6d28a7f9a5c96440ce50864b9d5f6356d331d39d6bb66c648e languageName: node linkType: hard @@ -1751,7 +1751,7 @@ __metadata: "@types/react": ^18.0.26 "@types/react-dom": ^18.0.10 "@vitejs/plugin-react": ^4.1.0 - prettier: ^2.8.4 + prettier: ^3.1.1 react: ^18.2.0 react-dom: ^18.2.0 typescript: ^4.9.4 diff --git a/demo/src/sandboxes/notification-hub/src/App.tsx b/demo/src/sandboxes/notification-hub/src/App.tsx index 0ba986b279..253041fc75 100644 --- a/demo/src/sandboxes/notification-hub/src/App.tsx +++ b/demo/src/sandboxes/notification-hub/src/App.tsx @@ -48,7 +48,7 @@ function MessageHub({ }) ) }, - config: (item, index, phase) => key => phase === 'enter' && key === 'life' ? { duration: timeout } : config, + config: (item, index, phase) => key => (phase === 'enter' && key === 'life' ? { duration: timeout } : config), }) React.useEffect(() => { diff --git a/docs/app/components/Code/H.tsx b/docs/app/components/Code/H.tsx index 5799d9d36a..586196a44c 100644 --- a/docs/app/components/Code/H.tsx +++ b/docs/app/components/Code/H.tsx @@ -6,7 +6,7 @@ interface HProps { export const H = ({ index, id, ...props }: HProps) => { const getHighlightedWords = (): [ targetIndex: number[], - allHighlightWords: Element[] + allHighlightWords: Element[], ] => { const codeBlock = document.getElementById(id) if (!codeBlock) return [[], []] diff --git a/docs/app/helpers/analytics.ts b/docs/app/helpers/analytics.ts index 62db4ba4f6..da0cfd5514 100644 --- a/docs/app/helpers/analytics.ts +++ b/docs/app/helpers/analytics.ts @@ -7,7 +7,7 @@ export enum EventNames { type EventFactory< TEventName extends EventNames, - TAdditionalProps extends object = object + TAdditionalProps extends object = object, > = { name: TEventName additionalProps?: TAdditionalProps diff --git a/docs/app/hooks/useAnimatedHeader.ts b/docs/app/hooks/useAnimatedHeader.ts index c51747336f..5e29c19974 100644 --- a/docs/app/hooks/useAnimatedHeader.ts +++ b/docs/app/hooks/useAnimatedHeader.ts @@ -17,7 +17,7 @@ export const useAnimatedHeader = ({ styles: { top: SpringValue }, isStuck: boolean, scrollTop: number, - direction: SCROLL_DIR | undefined + direction: SCROLL_DIR | undefined, ] => { const [direction, scrollTop] = useWindowScrolling({ active: true, diff --git a/docs/package.json b/docs/package.json index 1387992ea6..f565f6eef7 100644 --- a/docs/package.json +++ b/docs/package.json @@ -55,8 +55,5 @@ "concurrently": "^8.0.1", "ts-node": "^10.9.1" }, - "engines": { - "node": ">=20.10.0" - }, "sideEffects": false } diff --git a/package.json b/package.json index cac1e6d601..bf41b43efb 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "jest-environment-jsdom": "^29.5.0", "konva": "^9.2.3", "mock-raf": "npm:@react-spring/mock-raf@1.1.1", - "prettier": "^2.8.4", + "prettier": "^3.1.1", "pretty-quick": "^3.1.3", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/packages/animated/src/AnimatedArray.ts b/packages/animated/src/AnimatedArray.ts index d31d2183bc..da86a70aee 100644 --- a/packages/animated/src/AnimatedArray.ts +++ b/packages/animated/src/AnimatedArray.ts @@ -8,7 +8,7 @@ type Source = AnimatedValue[] /** An array of animated nodes */ export class AnimatedArray< - T extends ReadonlyArray = Value[] + T extends ReadonlyArray = Value[], > extends AnimatedObject { protected declare source: Source constructor(source: T) { diff --git a/packages/animated/src/createHost.ts b/packages/animated/src/createHost.ts index 96b230fcdf..a45a2382c2 100644 --- a/packages/animated/src/createHost.ts +++ b/packages/animated/src/createHost.ts @@ -69,5 +69,5 @@ const getDisplayName = (arg: AnimatableComponent) => is.str(arg) ? arg : arg && is.str(arg.displayName) - ? arg.displayName - : (is.fun(arg) && arg.name) || null + ? arg.displayName + : (is.fun(arg) && arg.name) || null diff --git a/packages/animated/src/getAnimatedType.ts b/packages/animated/src/getAnimatedType.ts index 7d712a067d..eeac9b9a5a 100644 --- a/packages/animated/src/getAnimatedType.ts +++ b/packages/animated/src/getAnimatedType.ts @@ -11,8 +11,8 @@ export function getAnimatedType(value: any): AnimatedType { return parentNode ? (parentNode.constructor as any) : is.arr(value) - ? AnimatedArray - : isAnimatedString(value) - ? AnimatedString - : AnimatedValue + ? AnimatedArray + : isAnimatedString(value) + ? AnimatedString + : AnimatedValue } diff --git a/packages/animated/src/withAnimated.tsx b/packages/animated/src/withAnimated.tsx index 0221edd425..ba715d8dde 100644 --- a/packages/animated/src/withAnimated.tsx +++ b/packages/animated/src/withAnimated.tsx @@ -98,7 +98,10 @@ export const withAnimated = (Component: any, host: HostConfig) => { } class PropsObserver { - constructor(readonly update: () => void, readonly deps: Set) {} + constructor( + readonly update: () => void, + readonly deps: Set + ) {} eventObserved(event: FluidEvent) { if (event.type == 'change') { raf.write(this.update) diff --git a/packages/core/src/AnimationResult.ts b/packages/core/src/AnimationResult.ts index 3d604da089..60c7314054 100644 --- a/packages/core/src/AnimationResult.ts +++ b/packages/core/src/AnimationResult.ts @@ -9,13 +9,13 @@ export const getCombinedResult = ( results.length == 1 ? results[0] : results.some(result => result.cancelled) - ? getCancelledResult(target.get()) - : results.every(result => result.noop) - ? getNoopResult(target.get()) - : getFinishedResult( - target.get(), - results.every(result => result.finished) - ) + ? getCancelledResult(target.get()) + : results.every(result => result.noop) + ? getNoopResult(target.get()) + : getFinishedResult( + target.get(), + results.every(result => result.finished) + ) /** No-op results are for updates that never start an animation. */ export const getNoopResult = (value: any) => ({ diff --git a/packages/core/src/Interpolation.ts b/packages/core/src/Interpolation.ts index fe4e3c031e..c7ce600dc9 100644 --- a/packages/core/src/Interpolation.ts +++ b/packages/core/src/Interpolation.ts @@ -34,7 +34,7 @@ import { */ export class Interpolation< Input = any, - Output = any + Output = any, > extends FrameValue { /** Useful for debugging. */ key?: string diff --git a/packages/core/src/SpringRef.ts b/packages/core/src/SpringRef.ts index cf356a05e9..61f263dbfa 100644 --- a/packages/core/src/SpringRef.ts +++ b/packages/core/src/SpringRef.ts @@ -8,9 +8,9 @@ export interface ControllerUpdateFn { } export interface SpringRef { - (props?: ControllerUpdate | ControllerUpdateFn): AsyncResult< - Controller - >[] + ( + props?: ControllerUpdate | ControllerUpdateFn + ): AsyncResult>[] current: Controller[] /** Add a controller to this ref */ @@ -77,7 +77,7 @@ export interface SpringRef { } export const SpringRef = < - State extends Lookup = Lookup + State extends Lookup = Lookup, >(): SpringRef => { const current: Controller[] = [] diff --git a/packages/core/src/SpringValue.ts b/packages/core/src/SpringValue.ts index f20bb46f97..97e20d99b0 100644 --- a/packages/core/src/SpringValue.ts +++ b/packages/core/src/SpringValue.ts @@ -190,8 +190,8 @@ export class SpringValue extends FrameValue { node.constructor == AnimatedString ? 1 : payload - ? payload[i].lastPosition - : toValues![i] + ? payload[i].lastPosition + : toValues![i] let finished = anim.immediate let position = to @@ -800,8 +800,8 @@ export class SpringValue extends FrameValue { anim.toValues = hasFluidValue(to) ? null : goalType == AnimatedString - ? [1] - : toArray(goal) + ? [1] + : toArray(goal) } if (anim.immediate != immediate) { diff --git a/packages/core/src/helpers.ts b/packages/core/src/helpers.ts index a588ca5540..d583983e69 100644 --- a/packages/core/src/helpers.ts +++ b/packages/core/src/helpers.ts @@ -51,8 +51,8 @@ export const getDefaultProp = ( props.default === true ? props[key] : props.default - ? props.default[key] - : undefined + ? props.default[key] + : undefined const noopTransform = (value: any) => value @@ -187,11 +187,11 @@ export function computeGoal(value: T | FluidValue): T { return is.arr(value) ? value.map(computeGoal) : isAnimatedString(value) - ? (G.createStringInterpolator({ - range: [0, 1], - output: [value, value] as any, - })(1) as any) - : value + ? (G.createStringInterpolator({ + range: [0, 1], + output: [value, value] as any, + })(1) as any) + : value } export function hasProps(props: object) { diff --git a/packages/core/src/types/common.ts b/packages/core/src/types/common.ts index b6fd8aa22d..4b3f8b2fea 100644 --- a/packages/core/src/types/common.ts +++ b/packages/core/src/types/common.ts @@ -29,8 +29,8 @@ export type RawValues = { export type IsPlainObject = T extends ReadonlyArray ? Any : T extends object - ? object - : Any + ? object + : Any export type StringKeys = T extends IsPlainObject ? string & keyof T diff --git a/packages/core/src/types/functions.ts b/packages/core/src/types/functions.ts index 53124c72e5..7643197f41 100644 --- a/packages/core/src/types/functions.ts +++ b/packages/core/src/types/functions.ts @@ -48,7 +48,7 @@ export type SpringUpdateFn = T extends IsPlainObject interface AnyUpdateFn< T extends SpringValue | Controller, Props extends object = InferProps, - State = InferState + State = InferState, > { (to: SpringTo, props?: Props): AsyncResult (props: { to?: SpringToFn | Falsy } & Props): AsyncResult @@ -82,7 +82,7 @@ interface UpdateValueFn extends AnyUpdateFn> { type EventHandler< TResult extends Readable = any, TSource = unknown, - Item = undefined + Item = undefined, > = Item extends undefined ? (result: AnimationResult, ctrl: TSource, item?: Item) => void : (result: AnimationResult, ctrl: TSource, item: Item) => void @@ -94,39 +94,39 @@ type EventHandler< export type OnStart< TResult extends Readable, TSource, - Item = undefined + Item = undefined, > = EventHandler /** Called when a `SpringValue` changes */ export type OnChange< TResult extends Readable, TSource, - Item = undefined + Item = undefined, > = EventHandler export type OnPause< TResult extends Readable, TSource, - Item = undefined + Item = undefined, > = EventHandler export type OnResume< TResult extends Readable, TSource, - Item = undefined + Item = undefined, > = EventHandler /** Called once the animation comes to a halt */ export type OnRest< TResult extends Readable, TSource, - Item = undefined + Item = undefined, > = EventHandler export type OnResolve< TResult extends Readable, TSource, - Item = undefined + Item = undefined, > = EventHandler /** diff --git a/packages/core/src/types/internal.ts b/packages/core/src/types/internal.ts index 01cbc245ba..8a61b78d7e 100644 --- a/packages/core/src/types/internal.ts +++ b/packages/core/src/types/internal.ts @@ -18,15 +18,15 @@ export interface Readable { export type InferState = T extends Controller ? State : T extends SpringValue - ? U - : unknown + ? U + : unknown /** @internal */ export type InferProps = T extends Controller ? ControllerUpdate : T extends SpringValue - ? SpringUpdate - : Lookup + ? SpringUpdate + : Lookup /** @internal */ export type InferTarget = T extends object diff --git a/packages/core/src/types/objects.ts b/packages/core/src/types/objects.ts index a88d68f92b..57a7de4fc3 100644 --- a/packages/core/src/types/objects.ts +++ b/packages/core/src/types/objects.ts @@ -38,7 +38,7 @@ export type SpringValues = [T] extends [Any] // Wrap a type with `SpringValue` type SpringWrap = [ Exclude, - Extract // Arrays are animated. + Extract, // Arrays are animated. ] extends [object | void, never] ? never // Object literals cannot be animated. : SpringValue> | Extract diff --git a/packages/core/src/types/props.ts b/packages/core/src/types/props.ts index 8e77175623..5b9e16c895 100644 --- a/packages/core/src/types/props.ts +++ b/packages/core/src/types/props.ts @@ -143,7 +143,7 @@ export type SpringTo = export type ControllerUpdate< State extends Lookup = Lookup, - Item = undefined + Item = undefined, > = unknown & ToProps & ControllerProps /** @@ -151,7 +151,7 @@ export type ControllerUpdate< */ export interface ControllerProps< State extends Lookup = Lookup, - Item = undefined + Item = undefined, > extends AnimationProps { ref?: SpringRef from?: GoalValues | Falsy @@ -350,16 +350,16 @@ export type PickAnimated = unknown & ([Props] extends [Any] ? Lookup // Preserve "any" instead of resolving to "{}" : [object] extends [Props] - ? Lookup - : ObjectFromUnion< - Props extends { from: infer From } // extract prop from the `from` prop if it exists - ? From extends () => any - ? ReturnType - : ObjectType - : TransitionKey & keyof Props extends never - ? ToValues - : TransitionValues - >) + ? Lookup + : ObjectFromUnion< + Props extends { from: infer From } // extract prop from the `from` prop if it exists + ? From extends () => any + ? ReturnType + : ObjectType + : TransitionKey & keyof Props extends never + ? ToValues + : TransitionValues + >) /** * Pick the values of the `to` prop. Forward props are *not* included. diff --git a/packages/core/src/types/transition.ts b/packages/core/src/types/transition.ts index 2977b334f5..8fe1344e0a 100644 --- a/packages/core/src/types/transition.ts +++ b/packages/core/src/types/transition.ts @@ -41,10 +41,10 @@ export type TransitionValues = unknown & ? T extends ReadonlyArray ? Element : T extends (...args: any[]) => infer Return - ? Return extends ReadonlyArray - ? ReturnElement - : Return - : T + ? Return extends ReadonlyArray + ? ReturnElement + : Return + : T : never >, {} @@ -97,7 +97,7 @@ export type UseTransitionProps = Merge< export type TransitionComponentProps< Item, - Props extends object = any + Props extends object = any, > = unknown & UseTransitionProps & { keys?: ItemKeys> diff --git a/packages/shared/src/easings.ts b/packages/shared/src/easings.ts index ff650fb434..81d667358f 100644 --- a/packages/shared/src/easings.ts +++ b/packages/shared/src/easings.ts @@ -106,10 +106,10 @@ export const easings: EasingDictionary = { x === 0 ? 0 : x === 1 - ? 1 - : x < 0.5 - ? Math.pow(2, 20 * x - 10) / 2 - : (2 - Math.pow(2, -20 * x + 10)) / 2, + ? 1 + : x < 0.5 + ? Math.pow(2, 20 * x - 10) / 2 + : (2 - Math.pow(2, -20 * x + 10)) / 2, easeInCirc: x => 1 - Math.sqrt(1 - Math.pow(x, 2)), easeOutCirc: x => Math.sqrt(1 - Math.pow(x - 1, 2)), easeInOutCirc: x => @@ -126,22 +126,23 @@ export const easings: EasingDictionary = { x === 0 ? 0 : x === 1 - ? 1 - : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4), + ? 1 + : -Math.pow(2, 10 * x - 10) * Math.sin((x * 10 - 10.75) * c4), easeOutElastic: x => x === 0 ? 0 : x === 1 - ? 1 - : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1, + ? 1 + : Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1, easeInOutElastic: x => x === 0 ? 0 : x === 1 - ? 1 - : x < 0.5 - ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 - : (Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5)) / 2 + 1, + ? 1 + : x < 0.5 + ? -(Math.pow(2, 20 * x - 10) * Math.sin((20 * x - 11.125) * c5)) / 2 + : (Math.pow(2, -20 * x + 10) * Math.sin((20 * x - 11.125) * c5)) / 2 + + 1, easeInBounce: x => 1 - bounceOut(1 - x), easeOutBounce: bounceOut, easeInOutBounce: x => diff --git a/packages/shared/src/fluids.ts b/packages/shared/src/fluids.ts index a2fcc5e758..338fb81f88 100644 --- a/packages/shared/src/fluids.ts +++ b/packages/shared/src/fluids.ts @@ -86,9 +86,9 @@ type GetFluidValue = { } type GetFluidObservers = { - (target: FluidValue): ReadonlySet< - FluidObserver - > | null + ( + target: FluidValue + ): ReadonlySet> | null (target: object): ReadonlySet | null } diff --git a/packages/types/src/animated.ts b/packages/types/src/animated.ts index 1240dd4913..3758f5faeb 100644 --- a/packages/types/src/animated.ts +++ b/packages/types/src/animated.ts @@ -2,9 +2,9 @@ export type Animatable = T extends number ? number : T extends string - ? string - : T extends ReadonlyArray - ? Array extends T // When true, T is not a tuple - ? ReadonlyArray - : { [P in keyof T]: Animatable } - : never + ? string + : T extends ReadonlyArray + ? Array extends T // When true, T is not a tuple + ? ReadonlyArray + : { [P in keyof T]: Animatable } + : never diff --git a/packages/types/src/interpolation.ts b/packages/types/src/interpolation.ts index 439f7d2fd7..b2a24bbbd0 100644 --- a/packages/types/src/interpolation.ts +++ b/packages/types/src/interpolation.ts @@ -10,9 +10,9 @@ export interface InterpolatorFactory { interpolator: InterpolatorFn ): typeof interpolator - (config: InterpolatorConfig): ( - input: number - ) => Animatable + ( + config: InterpolatorConfig + ): (input: number) => Animatable ( range: readonly number[], @@ -20,10 +20,9 @@ export interface InterpolatorFactory { extrapolate?: ExtrapolateType ): (input: number) => Animatable - (...args: InterpolatorArgs): InterpolatorFn< - Input, - Output - > + ( + ...args: InterpolatorArgs + ): InterpolatorFn } export type InterpolatorArgs = @@ -32,7 +31,7 @@ export type InterpolatorArgs = | [ readonly number[], readonly Constrain[], - (ExtrapolateType | undefined)? + (ExtrapolateType | undefined)?, ] export type InterpolatorFn = (...inputs: Arrify) => Output diff --git a/targets/konva/src/animated.ts b/targets/konva/src/animated.ts index 0c20b8374b..92c4c8eac4 100644 --- a/targets/konva/src/animated.ts +++ b/targets/konva/src/animated.ts @@ -33,14 +33,14 @@ type AnimatedProp = [T, T] extends [infer T, infer DT] ? [DT] extends [never] ? never : DT extends void - ? undefined - : DT extends object - ? [AssignableKeys] extends [never] - ? DT extends ReadonlyArray - ? AnimatedStyles
- : DT - : AnimatedStyle - : DT | AnimatedLeaf + ? undefined + : DT extends object + ? [AssignableKeys] extends [never] + ? DT extends ReadonlyArray + ? AnimatedStyles
+ : DT + : AnimatedStyle + : DT | AnimatedLeaf : never // An animated array of style objects @@ -61,10 +61,10 @@ type AnimatedStyle = [T, T] extends [infer T, infer DT] ? DT extends void ? undefined : [DT] extends [never] - ? never - : DT extends object - ? { [P in keyof DT]: AnimatedStyle } - : DT | AnimatedLeaf + ? never + : DT extends object + ? { [P in keyof DT]: AnimatedStyle } + : DT | AnimatedLeaf : never // An animated primitive (or an array of them) diff --git a/targets/native/src/animated.ts b/targets/native/src/animated.ts index e4e938dfca..58a3b1447e 100644 --- a/targets/native/src/animated.ts +++ b/targets/native/src/animated.ts @@ -37,16 +37,16 @@ type AnimatedProp = [T, T] extends [infer T, infer DT] // T is a union, DT is ? [DT] extends [never] ? never : DT extends void - ? undefined - : DT extends ReadonlyArray - ? AnimatedArray
| AnimatedLeaf - : DT extends ReadonlyArray - ? TransformArray extends DT - ? AnimatedTransform - : AnimatedStyles
- : [AssignableKeys] extends [never] - ? DT | AnimatedLeaf - : AnimatedStyle
+ ? undefined + : DT extends ReadonlyArray + ? AnimatedArray
| AnimatedLeaf + : DT extends ReadonlyArray + ? TransformArray extends DT + ? AnimatedTransform + : AnimatedStyles
+ : [AssignableKeys] extends [never] + ? DT | AnimatedLeaf + : AnimatedStyle
: never type AnimatedArray> = { @@ -62,10 +62,10 @@ type AnimatedStyles> = unknown & ? DT extends ReadonlyArray ? AnimatedStyles
: DT extends object - ? [AssignableKeys] extends [never] - ? AnimatedProp
- : { [P in keyof DT]: AnimatedProp } - : DT + ? [AssignableKeys] extends [never] + ? AnimatedProp
+ : { [P in keyof DT]: AnimatedProp } + : DT : never } @@ -74,14 +74,14 @@ export type AnimatedStyle = [T, T] extends [infer T, infer DT] // T is a unio ? DT extends void ? undefined : [DT] extends [never] - ? never - : DT extends object - ? { - [P in keyof T]: P extends 'transform' - ? AnimatedTransform - : AnimatedStyle - } - : DT | AnimatedLeaf + ? never + : DT extends object + ? { + [P in keyof T]: P extends 'transform' + ? AnimatedTransform + : AnimatedStyle + } + : DT | AnimatedLeaf : never type TransformArray = Exclude diff --git a/targets/three/src/animated.ts b/targets/three/src/animated.ts index 8b7527c641..39f100b5e4 100644 --- a/targets/three/src/animated.ts +++ b/targets/three/src/animated.ts @@ -33,14 +33,14 @@ type AnimatedProp = [T, T] extends [infer T, infer DT] ? [DT] extends [never] ? never : DT extends void - ? undefined - : DT extends object - ? [AssignableKeys] extends [never] - ? DT extends ReadonlyArray - ? AnimatedStyles
- : DT - : AnimatedStyle - : DT | AnimatedLeaf + ? undefined + : DT extends object + ? [AssignableKeys] extends [never] + ? DT extends ReadonlyArray + ? AnimatedStyles
+ : DT + : AnimatedStyle + : DT | AnimatedLeaf : never // An animated array of style objects @@ -61,10 +61,10 @@ type AnimatedStyle = [T, T] extends [infer T, infer DT] ? DT extends void ? undefined : [DT] extends [never] - ? never - : DT extends object - ? { [P in keyof DT]: AnimatedStyle } - : DT | AnimatedLeaf + ? never + : DT extends object + ? { [P in keyof DT]: AnimatedStyle } + : DT | AnimatedLeaf : never // An animated primitive (or an array of them) diff --git a/targets/web/src/AnimatedStyle.ts b/targets/web/src/AnimatedStyle.ts index cff57357f0..040fd22adc 100644 --- a/targets/web/src/AnimatedStyle.ts +++ b/targets/web/src/AnimatedStyle.ts @@ -45,8 +45,8 @@ const isValueIdentity = (value: OneOrMore, id: number): boolean => is.arr(value) ? value.every(v => isValueIdentity(v, id)) : is.num(value) - ? value === id - : parseFloat(value) === id + ? value === id + : parseFloat(value) === id type Inputs = ReadonlyArray>[] type Transforms = ((value: any) => [string, boolean])[] @@ -91,8 +91,8 @@ export class AnimatedStyle extends AnimatedObject { const unit = pxTransforms.test(key) ? 'px' : degTransforms.test(key) - ? 'deg' - : '' + ? 'deg' + : '' inputs.push(toArray(value)) transforms.push( @@ -121,7 +121,10 @@ export class AnimatedStyle extends AnimatedObject { class FluidTransform extends FluidValue { protected _value: string | null = null - constructor(readonly inputs: Inputs, readonly transforms: Transforms) { + constructor( + readonly inputs: Inputs, + readonly transforms: Transforms + ) { super() } diff --git a/targets/web/src/animated.ts b/targets/web/src/animated.ts index 6b1c2818b2..8f3d5084e8 100644 --- a/targets/web/src/animated.ts +++ b/targets/web/src/animated.ts @@ -52,16 +52,16 @@ type AnimatedProp = [T, T] extends [infer T, infer DT] ? [DT] extends [never] ? never : DT extends void - ? undefined - : DT extends string | number - ? DT | AnimatedLeaf - : DT extends object - ? [ValidStyleProps
] extends [never] - ? DT extends ReadonlyArray - ? AnimatedStyles
- : DT - : AnimatedStyle - : DT | AnimatedLeaf + ? undefined + : DT extends string | number + ? DT | AnimatedLeaf + : DT extends object + ? [ValidStyleProps
] extends [never] + ? DT extends ReadonlyArray + ? AnimatedStyles
+ : DT + : AnimatedStyle + : DT | AnimatedLeaf : never // An animated array of style objects @@ -82,12 +82,12 @@ type AnimatedStyle = [T, T] extends [infer T, infer DT] ? DT extends void ? undefined : [DT] extends [never] - ? never - : DT extends string | number - ? DT | AnimatedLeaf - : DT extends object - ? AnimatedObject
- : DT | AnimatedLeaf + ? never + : DT extends string | number + ? DT | AnimatedLeaf + : DT extends object + ? AnimatedObject
+ : DT | AnimatedLeaf : never type AnimatedObject = @@ -150,6 +150,6 @@ type TransformProps = { number, // a4 number, number, - number + number, ] } diff --git a/targets/zdog/src/animated.ts b/targets/zdog/src/animated.ts index fcdbe2fe9b..391dc38e65 100644 --- a/targets/zdog/src/animated.ts +++ b/targets/zdog/src/animated.ts @@ -32,10 +32,10 @@ type AnimatedProp = [T, T] extends [infer T, infer DT] ? [DT] extends [never] ? never : DT extends void - ? undefined - : DT extends object - ? AnimatedStyle - : DT | AnimatedLeaf + ? undefined + : DT extends object + ? AnimatedStyle + : DT | AnimatedLeaf : never // An animated object of style attributes @@ -43,10 +43,10 @@ type AnimatedStyle = [T, T] extends [infer T, infer DT] ? DT extends void ? undefined : [DT] extends [never] - ? never - : DT extends object - ? { [P in keyof DT]: AnimatedStyle } - : DT | AnimatedLeaf + ? never + : DT extends object + ? { [P in keyof DT]: AnimatedStyle } + : DT | AnimatedLeaf : never // An animated primitive (or an array of them) diff --git a/targets/zdog/src/primitives.ts b/targets/zdog/src/primitives.ts index 3d48b303e0..717e07f569 100644 --- a/targets/zdog/src/primitives.ts +++ b/targets/zdog/src/primitives.ts @@ -6,8 +6,8 @@ type ZdogElements = { [P in keyof ZdogExports]: P extends 'Illustration' ? never : ZdogExports[P] extends ElementType - ? P - : never + ? P + : never }[keyof ZdogExports] export const primitives: { [key in ZdogElements]: ElementType } = { diff --git a/yarn.lock b/yarn.lock index d73e455f60..d93e2f058c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17359,7 +17359,7 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.7.1, prettier@npm:^2.8.4": +"prettier@npm:^2.7.1": version: 2.8.4 resolution: "prettier@npm:2.8.4" bin: @@ -17368,6 +17368,15 @@ __metadata: languageName: node linkType: hard +"prettier@npm:^3.1.1": + version: 3.1.1 + resolution: "prettier@npm:3.1.1" + bin: + prettier: bin/prettier.cjs + checksum: e386855e3a1af86a748e16953f168be555ce66d6233f4ba54eb6449b88eb0c6b2ca79441b11eae6d28a7f9a5c96440ce50864b9d5f6356d331d39d6bb66c648e + languageName: node + linkType: hard + "pretty-bytes@npm:5.6.0, pretty-bytes@npm:^5.6.0": version: 5.6.0 resolution: "pretty-bytes@npm:5.6.0" @@ -18058,7 +18067,7 @@ __metadata: jest-environment-jsdom: ^29.5.0 konva: ^9.2.3 mock-raf: "npm:@react-spring/mock-raf@1.1.1" - prettier: ^2.8.4 + prettier: ^3.1.1 pretty-quick: ^3.1.3 react: ^18.2.0 react-dom: ^18.2.0