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

new-for-builtins & no-new-buffer: Handle line breaks after new keyword #1301

Merged
merged 7 commits into from
May 22, 2021

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented May 20, 2021

When class name is not on the same line with return, auto-fix can break code.

() => {
	return new //
		Buffer()
}
() => {
	return // returns `undefined` here
		Buffer.from()
}

Added parentheses after return to fix this.

@sindresorhus
Copy link
Owner

Can you fix the merge conflict?

# Conflicts:
#	rules/new-for-builtins.js
#	rules/no-new-buffer.js
@sindresorhus sindresorhus merged commit d37439f into sindresorhus:main May 22, 2021
@fisker fisker deleted the new-expression-fix branch May 22, 2021 18: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