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

Require Node.js 12.20 and move to ESM #76

Merged
merged 6 commits into from
Jul 13, 2021

Conversation

Richienb
Copy link
Contributor

No description provided.

Richienb added 2 commits July 10, 2021 17:17
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@sindresorhus
Copy link
Owner

sindresorhus commented Jul 10, 2021

CI is failing

Richienb and others added 3 commits July 10, 2021 23:08
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
@Richienb Richienb requested a review from sindresorhus July 11, 2021 14:45
index.ts Outdated Show resolved Hide resolved
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
propertyKey: string,
descriptor: PropertyDescriptor,
): void => {
const input = target[propertyKey]; // eslint-disable-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These errors must be ignored because target: any and there is currently no viable alternative.
https://stackoverflow.com/questions/68343539/typescript-definition-of-target-in-a-decorator


const cacheItem = cache.get(key);
if (cacheItem) {
return cacheItem.data;
return cacheItem.data; // eslint-disable-line @typescript-eslint/no-unsafe-return
Copy link
Contributor Author

@Richienb Richienb Jul 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the return value of AnyFunction is any and FunctionToMemoize extends AnyFunction, the linter assumes that ReturnType<FunctionToMemoize> is any. However, the error is that any is not assignable to ReturnType<FunctionToMemoize>:

✖ 118:4 Unsafe return of type any from function with return type ReturnType<FunctionToMemoize>. @typescript-eslint/no-unsafe-return

This might be a bug with typescript-eslint.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a bug with typescript-eslint.

Open an issue ;)

@Richienb Richienb requested a review from sindresorhus July 12, 2021 14:27
@sindresorhus sindresorhus merged commit 32c01b1 into sindresorhus:main Jul 13, 2021
@sindresorhus
Copy link
Owner

Looks good ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants