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

Rule use-test conflicting with typing of t.context #293

Closed
pvdlg opened this issue Feb 14, 2020 · 3 comments · Fixed by #294
Closed

Rule use-test conflicting with typing of t.context #293

pvdlg opened this issue Feb 14, 2020 · 3 comments · Fixed by #294

Comments

@pvdlg
Copy link
Contributor

pvdlg commented Feb 14, 2020

The AVA documentation recommends to to type t.context as follow:

import anyTest, {TestInterface} from 'ava';

const test = anyTest as TestInterface<{foo: string}>;

However importing AVA as anyTest instead of test triggers the use-test rule.

I can make a PR but I don't know what the best solution is. Any suggestion?

@sindresorhus
Copy link
Member

Could we check if it's a TypeScript file and allow anyTest as a name then? I think the rule context exposes the source file name.

@novemberborn
Copy link
Member

Heh, I've been using ava as the default import. But anyTest is still fine.

@novemberborn
Copy link
Member

Thanks @pvdlg, 10.1.0 is now available 🎊

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