Skip to content

Commit

Permalink
Reformat with wp-prettier 2.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Mar 22, 2023
1 parent 7f33c1c commit 8c86c8f
Show file tree
Hide file tree
Showing 14 changed files with 290 additions and 316 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const colors = [

const Template: ComponentStory< typeof BorderBoxControl > = ( props ) => {
const { onChange, ...otherProps } = props;
const [ borders, setBorders ] = useState< typeof props[ 'value' ] >();
const [ borders, setBorders ] = useState< ( typeof props )[ 'value' ] >();

const onChangeMerged: ComponentProps<
typeof BorderBoxControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Layout } from './styles/box-control-styles';
import type { BoxControlInputControlProps } from './types';

const groupedSides = [ 'vertical', 'horizontal' ] as const;
type GroupedSide = typeof groupedSides[ number ];
type GroupedSide = ( typeof groupedSides )[ number ];

export default function AxialInputControls( {
onChange,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/combobox-control/stories/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const meta: ComponentMeta< typeof ComboboxControl > = {
};
export default meta;

const mapCountryOption = ( country: typeof countries[ number ] ) => ( {
const mapCountryOption = ( country: ( typeof countries )[ number ] ) => ( {
value: country.code,
label: country.name,
} );
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/palette-edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ export function PaletteEdit( {
{ hasElements && (
<>
{ isEditing && (
<PaletteEditListView< typeof elements[ number ] >
<PaletteEditListView< ( typeof elements )[ number ] >
canOnlyChangeValues={ canOnlyChangeValues }
elements={ elements }
// @ts-expect-error TODO: Don't know how to resolve
Expand All @@ -548,13 +548,13 @@ export function PaletteEdit( {
isGradient={ isGradient }
onClose={ () => setEditingElement( null ) }
onChange={ (
newElement: typeof elements[ number ]
newElement: ( typeof elements )[ number ]
) => {
debounceOnChange(
// @ts-expect-error TODO: Don't know how to resolve
elements.map(
(
currentElement: typeof elements[ number ],
currentElement: ( typeof elements )[ number ],
currentIndex: number
) => {
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const POSITIONS = {
corner: 'corner',
} as const;

export type Position = typeof POSITIONS[ keyof typeof POSITIONS ];
export type Position = ( typeof POSITIONS )[ keyof typeof POSITIONS ];

interface UseResizeLabelProps {
/** The label value. */
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-test-utils-playwright/src/request-utils/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const PAGE_STATUS = [

export type Page = {
id: number;
status: typeof PAGE_STATUS[ number ];
status: ( typeof PAGE_STATUS )[ number ];
};

export type CreatePagePayload = {
title?: string;
content?: string;
status: typeof PAGE_STATUS[ number ];
status: ( typeof PAGE_STATUS )[ number ];
date?: string;
date_gmt?: string;
};
Expand Down
5 changes: 3 additions & 2 deletions packages/e2e-test-utils-playwright/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function observeConsoleLogging( message: ConsoleMessage ) {
const type = message.type();
if (
! OBSERVED_CONSOLE_MESSAGE_TYPES.includes(
type as typeof OBSERVED_CONSOLE_MESSAGE_TYPES[ number ]
type as ( typeof OBSERVED_CONSOLE_MESSAGE_TYPES )[ number ]
)
) {
return;
Expand Down Expand Up @@ -85,7 +85,8 @@ function observeConsoleLogging( message: ConsoleMessage ) {
return;
}

const logFunction = type as typeof OBSERVED_CONSOLE_MESSAGE_TYPES[ number ];
const logFunction =
type as ( typeof OBSERVED_CONSOLE_MESSAGE_TYPES )[ number ];

// Disable reason: We intentionally bubble up the console message
// which, unless the test explicitly anticipates the logging via
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-post/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export const showBlockTypes =
( type ) =>
! (
Array.isArray( blockNames ) ? blockNames : [ blockNames ]
).includes( type )
).includes( type )
);

registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function PostTypeSupportCheck( { postType, children, supportKeys } ) {
if ( postType ) {
isSupported = (
Array.isArray( supportKeys ) ? supportKeys : [ supportKeys ]
).some( ( key ) => !! postType.supports[ key ] );
).some( ( key ) => !! postType.supports[ key ] );
}

if ( ! isSupported ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function ThemeSupportCheck( {
} ) {
const isSupported = (
Array.isArray( supportKeys ) ? supportKeys : [ supportKeys ]
).some( ( key ) => {
).some( ( key ) => {
const supported = themeSupports?.[ key ] ?? false;
// 'post-thumbnails' can be boolean or an array of post types.
// In the latter case, we need to verify `postType` exists
Expand Down
3 changes: 0 additions & 3 deletions packages/private-apis/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@
},
"include": [ "src/**/*" ]
}



Loading

0 comments on commit 8c86c8f

Please sign in to comment.