Skip to content

Instantly share code, notes, and snippets.

@viT-1
Last active January 13, 2022 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viT-1/6f24d9201e4b50f61e32959afe508407 to your computer and use it in GitHub Desktop.
Save viT-1/6f24d9201e4b50f61e32959afe508407 to your computer and use it in GitHub Desktop.
#gist-bookmark #eslint #js #airbnb #prototype

With AirBnB this code is bad:

Greeter.prototype.greet = function () {
	return `${greetText}, ${this.greetTarget}`;
};

This article helps me to fix code:

Greeter.prototype.greet = function greet() {
	return `${greetText}, ${this.greetTarget}`;
};

Arrow functions here are not suitable (just run jest 😉):

Greeter.prototype.greet = () => `${greetText}, ${this.greetTarget}`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment