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

BREAKING: Bump eslint-plugin-jest to ^26.x #228

Merged
merged 3 commits into from
Aug 15, 2022
Merged

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented Aug 13, 2022

Per @Gudahtt's recommendation in #225, bumps eslint-plugin-jest from major version 24 to major version 26. The rule snapshot diff looks like it will work for us, although the new recommended rule prefer-to-be will require manual fixes.

@rekmarks rekmarks requested a review from a team as a code owner August 13, 2022 03:35
@@ -40,18 +40,16 @@
"jest/no-standalone-expect": "error",
"jest/no-test-prefixes": "error",
"jest/no-test-return-statement": "error",
"jest/no-try-expect": "error",
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a deprecated / removed precursor of no-conditional-expect.

"jest/prefer-hooks-on-top": "error",
"jest/prefer-spy-on": "error",
"jest/prefer-strict-equal": "error",
"jest/prefer-to-be-null": "error",
"jest/prefer-to-be-undefined": "error",
"jest/prefer-to-be": "error",
Copy link
Member Author

Choose a reason for hiding this comment

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

Supersedes to-be-x: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-to-be.md

This may actually be breaking, because it looks like it will make us use toBe for all primitives that don't have specific toBeX matchers.

"jest/prefer-to-contain": "error",
"jest/prefer-to-have-length": "error",
"jest/prefer-todo": "error",
"jest/require-to-throw-message": "error",
"jest/require-top-level-describe": "error",
"jest/valid-describe": "error",
"jest/valid-describe-callback": "error",
Copy link
Member Author

Choose a reason for hiding this comment

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

This is just a non-functional rename: jest-community/eslint-plugin-jest@f3e9e9a

@rekmarks rekmarks changed the title Bump eslint-plugin-jest to ^26.x BREAKING: Bump eslint-plugin-jest to ^26.x Aug 13, 2022
'jest/no-duplicate-hooks': 'error',
'jest/no-if': 'error',
'jest/no-test-return-statement': 'error',
'jest/prefer-hooks-on-top': 'error',
'jest/prefer-lowercase-title': ['error', { ignore: ['describe'] }],
Copy link
Member Author

Choose a reason for hiding this comment

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

This was renamed (see jest-community/eslint-plugin-jest#950), but I only caught it when running eslint with the latest release of this config and the latest Jest plugin. We should add a test of some kind to CI that catches rules that no longer exist.

Copy link
Member Author

Choose a reason for hiding this comment

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

Gudahtt
Gudahtt previously approved these changes Aug 13, 2022
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!

@Gudahtt Gudahtt dismissed their stale review August 13, 2022 19:45

Noticed a problem

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.

This version of eslint-plugin-jest depends upon v5 of @typescript-eslint/eslint-plugin, but we're still on v4. See https://github.com/jest-community/eslint-plugin-jest/blob/v26.8.2/package.json#L143

Edit: update done here: #230

@Gudahtt Gudahtt dismissed their stale review August 15, 2022 15:23

PR #230 has been merged, so the requested change has been made

@Gudahtt
Copy link
Member

Gudahtt commented Aug 15, 2022

I have just rebased this PR to resolve the conflicts. The only conflicts were in the lockfile, which Yarn resolved automatically upon install.

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 8aa85ee into main Aug 15, 2022
@rekmarks rekmarks deleted the eslint-plugin-jest@26.8.2 branch August 15, 2022 17:14
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