Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
chore: trying to get it to work
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jan 19, 2021
1 parent 37d9ac8 commit ea4a484
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/ts-types/src/types/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export interface AnyArray<T = unknown> extends Array<T> {}
export interface AnyArrayLike<T = unknown> extends ArrayLike<T> {}

/**
* Typescript recommends using this instead of the generic object type. See https://github.com/microsoft/TypeScript/issues/21732
* Typescript recommends using Record<string, unknown> instead of the generic object type. See https://github.com/microsoft/TypeScript/issues/21732.
* However, this breaks current functionality so we aliased the object type and disabled eslint for now.
*/
export type AnyObject = Record<string, unknown>;
// eslint-disable-next-line @typescript-eslint/ban-types
export type AnyObject = object;
2 changes: 1 addition & 1 deletion packages/ts-types/src/types/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ import { AnyObject } from './collection';
export type AnyFunction<T = unknown> = (...args: any[]) => T;

/**
* A constructor for any type `T`. `T` defaults to `object` when not explicitly supplied.
* A constructor for any type `T`. `T` defaults to `AnyObject` when not explicitly supplied.
*/
export type AnyConstructor<T = AnyObject> = new (...args: any[]) => T;

0 comments on commit ea4a484

Please sign in to comment.