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

[Question] How to use with jest? #905

Closed
katopz opened this issue Jun 1, 2017 · 8 comments

Comments

@katopz
Copy link

commented Jun 1, 2017

image

Usually I use /* eslint-env jest */ for eslint how can I do this with standard?

Thanks

@dcousens

This comment has been minimized.

Copy link
Member

commented Jun 1, 2017

/* eslint-env jest */ will probably work

@dcousens dcousens added the question label Jun 1, 2017

@katopz

This comment has been minimized.

Copy link
Author

commented Jun 1, 2017

@dcousens Hm, I still see error there? Do I miss something?

image

@dcousens

This comment has been minimized.

Copy link
Member

commented Jun 1, 2017

Not sure, sorry.

boo globals anyway.

@blgm

This comment has been minimized.

Copy link

commented Jun 3, 2017

Does the standard command report problems? If you are only seeing issues in the editor, then the issue is likely to be with the editor's standard plugin. Which editor are you using?

I've been using standard, jest and Atom; and /* eslint-env jest */ is working for me.

@katopz

This comment has been minimized.

Copy link
Author

commented Jun 6, 2017

@blgm standard command did report usual format problems. I use VSCode and /* eslint-env jest */ work fine without standard plugin (working with ESLint extension I mean).

Thanks

@dcousens dcousens closed this Jun 7, 2017

@dcousens

This comment has been minimized.

Copy link
Member

commented Jun 7, 2017

@katopz try a different editor, and if the problem persists with repro, we'll re-open the issue

@fullstackzach

This comment has been minimized.

Copy link

commented Mar 21, 2018

I found that this works, at the top of your test/spec file

/* global test, describe, it, expect, jest */

This will exclude those global namespaces from standard linting

@bcomnes

This comment has been minimized.

Copy link
Member

commented Mar 21, 2018

Declaring eslint environments at the top of the file helps provide context to the globals that are used as well. 👍 to that

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
5 participants
You can’t perform that action at this time.