Skip to content

Update ESLint rules for test suite#8023

Merged
whymarrh merged 4 commits intoMetaMask:developfrom
whymarrh:eslint-mocha
Feb 11, 2020
Merged

Update ESLint rules for test suite#8023
whymarrh merged 4 commits intoMetaMask:developfrom
whymarrh:eslint-mocha

Conversation

@whymarrh
Copy link
Contributor

@whymarrh whymarrh commented Feb 9, 2020

This PR updates our ESLint config to enable more Mocha rules targeting our test suite.

There is a bit of whitespace changes/diff noise here (I'd recommend hiding it during review) but a lot of these changes are due to mocha/no-mocha-arrows which disallows arrow functions for Mocha tests. Mocha discourages passing it arrow functions as arguments.[1]

This is based on MetaMask/eslint-config#13—we now have a shared Mocha config.

@whymarrh whymarrh force-pushed the eslint-mocha branch 4 times, most recently from 66e4595 to e24bee6 Compare February 9, 2020 19:15
@whymarrh whymarrh marked this pull request as ready for review February 11, 2020 15:33
@whymarrh whymarrh requested a review from tmashuang February 11, 2020 15:34
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@whymarrh whymarrh merged commit 4f3fc95 into MetaMask:develop Feb 11, 2020
@whymarrh whymarrh deleted the eslint-mocha branch February 11, 2020 16:51
yqrashawn pushed a commit to yqrashawn/conflux-portal that referenced this pull request Feb 14, 2020
* Use @metamask/eslint-config@1.1.0
* Use eslint-plugin-mocha@6.2.2
* Mark root ESLint config as root
* Update Mocha ESLint rules with shared ESLint config
github-merge-queue bot pushed a commit that referenced this pull request Mar 5, 2025
#30661)

## **Description**

@davidmurdoch requested this feature here:
#30440 (review)

Also adds to the VSCode GitLens settings. If a Cursor user could help
with the Cursor settings, that would be much appreciated.

We should discuss:

- The inclusion of #17092, as I'm undecided about it
- Whether it's appropriate to automatically execute `git config
blame.ignoreRevsFile .git-blame-ignore-revs` in `postinstall`. It writes
to the local `.git/config` file in your `metamask-extension` folder, so
it's only changing that one folder.

Command to get commits with over 200 file changes
```
git log --pretty=format:"%H %s" --shortstat | awk '{if ($1 ~ /^[0-9]+$/) {num = $1 + 0; if (num > 200 && current_hash !~ /Revert/) print num " " current_hash} else current_hash = $0}' | sort -nr
```

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/30661?quickstart=1)

## **Related issues**

David Murdoch request:
#30440 (review)

## **Ignored PRs**

- #6304 
- #7730 
- #8023 
- #8056 
- #8595 
- #9239 
- #9274 
- #10358
- #10655
- #10911
- #17092
- #22639
- #22531
- #30440

<!--## **Manual testing steps**
## **Screenshots/Recordings**
## **Pre-merge author checklist**
## **Pre-merge reviewer checklist**-->

---------

Co-authored-by: David Murdoch <187813+davidmurdoch@users.noreply.github.com>
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