Skip to content

Commit

Permalink
fix use unknown instead of any for unknown additional props
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed May 15, 2024
1 parent 186eecc commit 047208a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions components/author/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useAuthor } from './context';

interface NameProps {
tagName?: keyof JSX.IntrinsicElements;
[key: string]: any;
[key: string]: unknown;
}

export const Name: React.FC<NameProps> = (props) => {
Expand All @@ -22,7 +22,7 @@ export const Name: React.FC<NameProps> = (props) => {

interface FirstNameProps {
tagName?: keyof JSX.IntrinsicElements;
[key: string]: any;
[key: string]: unknown;
}

export const FirstName: React.FC<FirstNameProps> = (props) => {
Expand All @@ -34,7 +34,7 @@ export const FirstName: React.FC<FirstNameProps> = (props) => {

interface LastNameProps {
tagName?: keyof JSX.IntrinsicElements;
[key: string]: any;
[key: string]: unknown;
}

export const LastName: React.FC<LastNameProps> = (props) => {
Expand All @@ -54,7 +54,7 @@ function useDefaultAvatar() {
}

interface AvatarProps {
[key: string]: any;
[key: string]: unknown;
}

export const Avatar: React.FC<AvatarProps> = (props) => {
Expand All @@ -71,7 +71,7 @@ export const Avatar: React.FC<AvatarProps> = (props) => {

interface BioProps {
tagName?: keyof JSX.IntrinsicElements;
[key: string]: any;
[key: string]: unknown;
}

export const Bio: React.FC<BioProps> = (props) => {
Expand All @@ -82,7 +82,7 @@ export const Bio: React.FC<BioProps> = (props) => {
};

interface EmailProps {
[key: string]: any;
[key: string]: unknown;
}

export const Email: React.FC<EmailProps> = (props) => {
Expand Down
2 changes: 1 addition & 1 deletion components/post-author/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { Author } from '../author/context';

interface PostAuthorProps {
children?: React.ReactNode | ((author: Author) => React.ReactNode);
[key: string]: any;
[key: string]: unknown;
}

export const PostAuthor: React.FC<PostAuthorProps> & {
Expand Down
2 changes: 1 addition & 1 deletion components/post-date/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface PostDateProps {
/**
* Remaining props to pass to the time element.
*/
[key: string]: any;
[key: string]: unknown;
}

export const PostDate: React.FC<PostDateProps> = ({ placeholder = __('No date set', 'tenup'), format, ...rest}) => {
Expand Down
2 changes: 1 addition & 1 deletion components/post-meta/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface PostMetaProps {
/**
* Additional props to pass to the component.
*/
[key: string]: any;
[key: string]: unknown;
}

export const PostMeta: React.FC<PostMetaProps> & {
Expand Down
2 changes: 1 addition & 1 deletion hooks/use-block-parent-attributes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function useBlockParentAttributes() {

const { updateBlockAttributes } = useDispatch(blockEditorStore);

const setParentAttributes = (attributes: {[key: string]: any}) => {
const setParentAttributes = (attributes: {[key: string]: unknown}) => {
updateBlockAttributes(parentBlockClientId, attributes);
};

Expand Down

0 comments on commit 047208a

Please sign in to comment.