Skip to content

Commit

Permalink
Implementing feedback. Using @ts-expect-error instead of ignore, an…
Browse files Browse the repository at this point in the history
…d fixing type assignment
  • Loading branch information
ramonjd committed Dec 4, 2024
1 parent 97c723c commit 90e7a49
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
7 changes: 4 additions & 3 deletions packages/edit-site/src/components/style-book/categories.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* WordPress dependencies
*/
// @ts-ignore
// @wordpress/blocks imports are not typed.
// @ts-expect-error
import { getCategories } from '@wordpress/blocks';

/**
Expand Down Expand Up @@ -30,11 +31,11 @@ export function getExamplesByCategory(
if ( ! categoryDefinition?.slug || ! examples?.length ) {
return;
}
const categories: StyleBookCategory[] =
const categories: CategoryExamples[] =
categoryDefinition?.subcategories ?? [];
if ( categories.length ) {
return categories.reduce(
( acc, subcategoryDefinition ): CategoryExamples => {
( acc, subcategoryDefinition ) => {
const subcategoryExamples = getExamplesByCategory(
subcategoryDefinition,
examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import clsx from 'clsx';
import { __experimentalGrid as Grid } from '@wordpress/components';
import { View } from '@wordpress/primitives';
import {
// @ts-ignore
getColorClassName,
// @ts-ignore
__experimentalGetGradientClass,
// @ts-ignore
// @wordpress/block-editor imports are not typed.
// @ts-expect-error
} from '@wordpress/block-editor';

/**
Expand Down
7 changes: 2 additions & 5 deletions packages/edit-site/src/components/style-book/examples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
*/
import { __, sprintf } from '@wordpress/i18n';
import {
// @ts-ignore
getBlockType,
// @ts-ignore
getBlockTypes,
// @ts-ignore
getBlockFromExample,
// @ts-ignore
createBlock,
// @ts-ignore
// @wordpress/blocks imports are not typed.
// @ts-expect-error
} from '@wordpress/blocks';

/**
Expand Down

0 comments on commit 90e7a49

Please sign in to comment.