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

languages: Prefer arrow callbacks in ES6 #573

Merged
merged 1 commit into from
May 21, 2024
Merged

languages: Prefer arrow callbacks in ES6 #573

merged 1 commit into from
May 21, 2024

Conversation

edg2s
Copy link
Member

@edg2s edg2s commented May 17, 2024

Also prefer single-line body-less style when possible.

Fixes #572

@edg2s
Copy link
Member Author

edg2s commented May 20, 2024

cc @MatmaRex

@Krinkle
Copy link
Member

Krinkle commented May 20, 2024

If there isn't one already, I suggest adding a QUnit.test() case that involves this.something (e.g. from a beforeEach hook), to make sure it neither warns about nor tries to "fix" those. Or, I suppose, really in any input file, it doesn't have to be a QUnit test per-se.

@edg2s
Copy link
Member Author

edg2s commented May 21, 2024

prefer-arrow-callback is conservative and the autofix is designed to never introduce an error, e.g. if this or arguments is present in the function body:

https://eslint.org/docs/latest/rules/prefer-arrow-callback#:~:text=unbound%20function%20expression

Also prefer single-line body-less style when possible.

Fixes #572
@edg2s
Copy link
Member Author

edg2s commented May 21, 2024

@Krinkle Krinkle merged commit fd77d8b into main May 21, 2024
6 checks passed
@Krinkle Krinkle deleted the arrow-callback branch May 21, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Prefer arrow callbacks in ES6 code
2 participants