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

Mocha-aware prefer-arrow-callback #141

Closed
paulmelnikow opened this issue Sep 24, 2017 · 4 comments
Closed

Mocha-aware prefer-arrow-callback #141

paulmelnikow opened this issue Sep 24, 2017 · 4 comments

Comments

@paulmelnikow
Copy link

As discussed at eslint/eslint#9255, it would be great to have a Mocha-aware version of prefer-arrow-callback which ignored Mocha globals but triggered errors for everything else.

I would turn this on in a jiffy!

@vhmth
Copy link

vhmth commented Nov 24, 2017

Could anyone point me in the proper direction for which files to generally look at to implement this? We would definitely love to have this at Loom. Currently we need two separate ESLint configs (one for our tests and one for all other stuff).

@paulmelnikow
Copy link
Author

I wrote the no-mocha-arrows rule. You need to add a file in lib/rules, another in test/rules, and also update the docs. I'd suggest reading that one, and also the eslint core rule for prefer-arrow-callback.

@astorije
Copy link

In terms of usage, would making it similar to eslint-plugin-chai-friendly's no-unused-expressions make sense?
I.e. in a test-specific .eslintrc.yml, one would set it up with:

rules:
  prefer-arrow-callback: off
  mocha/prefer-arrow-callback: error

I too would happily use it and get rid of my ugly eslint-disable-line comments :)

@lo1tuma
Copy link
Owner

lo1tuma commented Jul 6, 2018

Thanks to @quarklemotion this has been shipped in version 5.1.0.

@lo1tuma lo1tuma closed this as completed Jul 6, 2018
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

No branches or pull requests

4 participants