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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use suggestion instead of fix #586

Merged
merged 8 commits into from Jun 20, 2020
Merged

Use suggestion instead of fix #586

merged 8 commits into from Jun 20, 2020

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented May 16, 2020

I've done these as fixs because they're safer, so feels like it's ok to do a patch in?

Also I realised how to break no-test-callback by not checking that it's type is an Identifier 馃槀

Are there any other rules we think should use an suggestion instead of autofixing? (or that don't have any fixes already that could suggest).

fixes #483
fixes #586

@G-Rath G-Rath requested review from SimenB and jeysal May 16, 2020 23:29
@G-Rath
Copy link
Collaborator Author

G-Rath commented May 16, 2020

Also I just realised that we can simplify the fixer for no-test-callback 馃コ

Actually, it doesn't simplify it as much as I thought :/

@G-Rath G-Rath force-pushed the use-suggestion-instead-of-fix branch from 050be4c to 526b608 Compare May 16, 2020 23:31
@G-Rath
Copy link
Collaborator Author

G-Rath commented May 16, 2020

Ah bugger - because eslint@5 doesn't support suggestions, we can't hit our coverage target.

@SimenB would you be ok with ignoring the coverage target for eslint v5?

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

dropping coverage check on eslint 5 sounds good

src/rules/prefer-strict-equal.ts Show resolved Hide resolved
@@ -16,41 +17,132 @@ ruleTester.run('no-test-callback', rule, {
'test("something", function() {})',
'test("something", async function () {})',
'test("something", someArg)',
'test("something", (...args) => {args[0]();})',
Copy link
Member

Choose a reason for hiding this comment

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

we should error here as well, although we can't apply the fix.

Jest just provides the one argument, so it's just the fixer that doesn't work, with the rule active we should still warn about this case

@G-Rath G-Rath force-pushed the use-suggestion-instead-of-fix branch 3 times, most recently from 8532f5d to 31bcaab Compare May 21, 2020 23:53
@G-Rath G-Rath requested a review from SimenB May 21, 2020 23:54
@G-Rath G-Rath force-pushed the use-suggestion-instead-of-fix branch 2 times, most recently from 7e6a91b to 5cd30c6 Compare May 24, 2020 21:22
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

馃憦

@G-Rath G-Rath force-pushed the use-suggestion-instead-of-fix branch 3 times, most recently from e295d24 to ee19dee Compare June 20, 2020 09:17
@G-Rath G-Rath force-pushed the use-suggestion-instead-of-fix branch 2 times, most recently from b459153 to 7c828d2 Compare June 20, 2020 11:23
@G-Rath G-Rath force-pushed the use-suggestion-instead-of-fix branch from 7c828d2 to e9a3e58 Compare June 20, 2020 11:31
@G-Rath G-Rath merged commit 7e4e37a into master Jun 20, 2020
@G-Rath G-Rath deleted the use-suggestion-instead-of-fix branch June 20, 2020 22:26
@github-actions
Copy link

馃帀 This PR is included in version 23.14.0 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[prefer-expect-assertions]: Suggest expect.hasAssertions fix
2 participants