eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

typescript/define-function-in-one-statement

ESLint plugin / typescript/define-function-in-one-statement

Requires that function is defined in one statement.

module.exports = {
  plugins: ["misc"],
  rules: {
    "misc/typescript/define-function-in-one-statement": "error"
  }
};

Examples of incorrect code

function f() {}
f.x = 1;

Examples of correct code

const f = Object.assign(() => {}, { x: 1 });