目录

@typescript-eslint/no-empty-function

Disallow empty functions.

Rule Configuration

// code-linter.json5
{
  "rules": {
    "@typescript-eslint/no-empty-function": "error"
  }
}

Options

For details, see @typescript-eslint/no-empty-function.

Example of Correct Code

This rule is aimed at eliminating empty functions. A function will not be considered a problem if it contains a comment.

/*eslint no-empty-function: "error"*/
function foo() {
  // do nothing.
}

const baz = () => {
  foo();
};

export class Bar {
  public meth1() {
    // do something
  }

  public meth2() {
    baz();
  }
}

Example of Incorrect Code

/*eslint no-empty-function: "error"*/
function foo() {

}

const baz = () => {

};

export class Bar {
  public meth1() {

  }

  public meth2() {

  }
}

Rule Set

plugin:@typescript-eslint/all

For details about how to configure Code Linter check rules, see Code Linter.