Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Aug 17, 2022
1 parent 24bb0f9 commit b2a29a6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/media/src/hasVideoGotAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html

interface AudioTrackList {
[Symbol.iterator](): IterableIterator<any>;
[Symbol.iterator](): IterableIterator<unknown>;
length: number;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/media/src/normalizeResourceSizes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import type { ResourceSize } from './types';
*/
function normalizeResourceSizes(sizes?: {
[key: string]: {
width: any;
height: any;
width: number | string;
height: number | string;
mimeType: string;
sourceUrl: string;
};
Expand Down
7 changes: 6 additions & 1 deletion packages/media/src/preloadImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ interface ImageArguments {
* @param {number|string} attr.height Image height.
* @return {Promise} Image object.
*/
function preloadImage({ src, srcset, width, height }: ImageArguments): Promise<HTMLImageElement> {
function preloadImage({
src,
srcset,
width,
height,
}: ImageArguments): Promise<HTMLImageElement> {
return new Promise((resolve, reject) => {
const image = new window.Image(Number(width), Number(height));
image.onload = () => resolve(image);
Expand Down
3 changes: 2 additions & 1 deletion packages/media/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
* External dependencies
*/
import * as PropTypes from 'prop-types';
import type { Requireable } from 'prop-types';

const ResourcePropTypes: any = {};
const ResourcePropTypes: Record<string, Requireable<unknown>> = {};

ResourcePropTypes.resourceSize = PropTypes.shape({
file: PropTypes.string,
Expand Down

0 comments on commit b2a29a6

Please sign in to comment.