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

expectType is not compatible with @typescript-eslint/no-unsafe-call #99

Closed
sindresorhus opened this issue May 9, 2021 · 2 comments · Fixed by #120
Closed

expectType is not compatible with @typescript-eslint/no-unsafe-call #99

sindresorhus opened this issue May 9, 2021 · 2 comments · Fixed by #120

Comments

@sindresorhus
Copy link
Collaborator

It's causing a lint error:

import {expectType} from 'tsd';
import normalizeNewline from './index.js';

expectType<string>(normalizeNewline('foo\r\nbar\nbaz'));
❯ xo

  index.test-d.ts:4:1
  ✖  4:1  Unsafe call of an any typed value.  @typescript-eslint/no-unsafe-call
sindresorhus added a commit to xojs/eslint-config-xo-typescript that referenced this issue May 9, 2021
@SamVerschueren
Copy link
Collaborator

Is this a bug in the rule? Because expecType is typed correctly and if I add it to the code directly, like this, it just works.

import normalizeNewline from './index.js';

declare const expectType: <T>(value: T) => void;

expectType<string>(normalizeNewline('foo\r\nbar\nbaz'));

So I'm wondering what could actually cause this 🤔 .

@BendingBender
Copy link
Collaborator

@sindresorhus I tried to reproduce this with the current version of eslint, without any success. See #120. Do you still have this problem with one of your projects?

codehub0x added a commit to codehub0x/eslint-typescript that referenced this issue Jul 18, 2021
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 a pull request may close this issue.

3 participants