Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: use unknown instead of any for unknown additional props #324

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading