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

@metamask/eslint config@6.0.0 #442

Merged
merged 10 commits into from
Apr 15, 2021
Merged

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Apr 13, 2021

This PR adds @metamask/eslint-config@6.0.0 and sibling packages from that major version. As you can see, the diff is enormous. However, most of the changes are programmatic and contained within single commits, so reviewing won't be as bad as it looks.

The end result of this effort is to bring this repository onto the same lint standards as everywhere else in the organization. The package's own prettier config is removed.

Changes prefixed with "❗" required manual fixing and deserve extra attention.

  • 05500ab
    • This makes the necessary package updates and changes to .eslintrc.js
    • ❗ Notably, it stops extending the jest rules for every file, and moves them into an override targeting test files only.
    • ❗ Redundant rules were removed in this commit.
      • "Redundant" meaning they were identically configured by an extended config.
  • b99cdb0
    • ❗ Update the CI config and package scripts. The format scripts and CI job are removed since formatting is now done during lint.
  • b8fa351
    • Run yarn lint:fix and replace toEqual with toStrictEqual in tests.
    • Some instances of toEqual were left over after the rebase. They're fixed fdec723.
  • 2fa8725
    • ❗ Manually fix test failures resulting from the migration to toStrictEqual.
  • 257fc97
    • ❗ Manually replace jest .resolves matchers.
  • 5f3d819
    • ❗ Update local jest rules and move them to the override added in 5b4957c.
  • e5090fb
    • Remove lint-staged and the local prettier config.
  • fdec723
    • Run yarn lint:fix to fix all prettier violations following the removal of the local prettier config.
    • Replace remaining toEqual instances with toStrictEqual.

Base automatically changed from bump-node-version to develop April 13, 2021 16:17
@rekmarks rekmarks marked this pull request as ready for review April 13, 2021 16:17
@rekmarks rekmarks requested a review from a team as a code owner April 13, 2021 16:17
ryanml
ryanml previously approved these changes Apr 13, 2021
Copy link
Contributor

@ryanml ryanml left a comment

Choose a reason for hiding this comment

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

Config changes look good and seem to be in line with recent changes across the organization. Programmatic diffs look fine as well. I'll additionally refer to @Gudahtt for review

@rekmarks
Copy link
Member Author

/yolo

@Gudahtt
Copy link
Member

Gudahtt commented Apr 13, 2021

I'm tempted to ask that this be delayed until after #378 and #387. Both of those PRs would have many conflicts with this, and I suspect it would be easier to resolve them in this PR because the last commit can be redone fairly easily (the yarn lint:fix one).

@rekmarks rekmarks marked this pull request as draft April 13, 2021 23:35
.eslintrc.js Outdated
'error',
{
resolves: 'Use `expect(await promise)` instead.',
// 'toBeFalsy': 'Avoid `toBeFalsy`',
Copy link
Member

Choose a reason for hiding this comment

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

👀

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see, these are restricted matchers in our config that we use here? Maybe worth adding a comment explaining this

.eslintrc.js Show resolved Hide resolved
.eslintrc.js Outdated Show resolved Hide resolved
@rekmarks rekmarks force-pushed the @metamask/eslint-config@6.0.0 branch 2 times, most recently from 7d1e059 to 76eb3f2 Compare April 14, 2021 16:03
@rekmarks rekmarks force-pushed the @metamask/eslint-config@6.0.0 branch from 76eb3f2 to 0db3170 Compare April 15, 2021 18:20
@rekmarks rekmarks marked this pull request as ready for review April 15, 2021 18:26
@rekmarks rekmarks force-pushed the @metamask/eslint-config@6.0.0 branch from 0db3170 to 6baa86d Compare April 15, 2021 18:31
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!

@rekmarks rekmarks merged commit f421f1e into develop Apr 15, 2021
@rekmarks rekmarks deleted the @metamask/eslint-config@6.0.0 branch April 15, 2021 22:38
Gudahtt added a commit that referenced this pull request Apr 15, 2021
- Add restricted controller messenger ([#378](#378))

- **BREAKING:** Update minimum Node.js version to v12 ([#441](#441))
- **BREAKING:** Replace controller context ([#387](#387))
- Bump @metamask/contract-metadata from 1.23.0 to 1.24.0 ([#440](#440))
- Update lint rules ([#442](#442), [#426](#426))

- Don't remove collectibles during auto detection ([#439](#439))
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* @metamask/eslint*config@6.0.0
  * Make necessary package updates and changes to .eslintrc.js.
* Remove lint*staged dependency
* Remove the local Prettier config
* Remove rules made redundant by new config
* Update the CI config and package scripts.
  * The `format` scripts and CI job were removed since formatting is now done during the lint script.
* Only extend Jest rules for test files, update Jest rules
* Replace "toEqual" with "toStrictEqual" in tests
* Replace Jest "resolves" matchers with config-permitted equivalents
* Run `yarn lint:fix` and replace `toEqual` with `toStrictEqual` in tests.
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
* @metamask/eslint*config@6.0.0
  * Make necessary package updates and changes to .eslintrc.js.
* Remove lint*staged dependency
* Remove the local Prettier config
* Remove rules made redundant by new config
* Update the CI config and package scripts.
  * The `format` scripts and CI job were removed since formatting is now done during the lint script.
* Only extend Jest rules for test files, update Jest rules
* Replace "toEqual" with "toStrictEqual" in tests
* Replace Jest "resolves" matchers with config-permitted equivalents
* Run `yarn lint:fix` and replace `toEqual` with `toStrictEqual` in tests.
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.

3 participants