eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

prefer-arrow-function-property

ESLint plugin / prefer-arrow-function-property

Requires use of arrow functions.

module.exports = {
  plugins: ["misc"],
  rules: {
    "misc/prefer-arrow-function-property": "error"
  }
};

Examples of incorrect code

const x = {
  f() {},
  g: function () {}
};

Examples of correct code

const x = {
  f: () => {},
  g(this: void) {},
  h: function (this: void) {}
};