Disallow empty functions.
// code-linter.json5
{
"rules": {
"@typescript-eslint/no-empty-function": "error"
}
} 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();
}
} /*eslint no-empty-function: "error"*/
function foo() {
}
const baz = () => {
};
export class Bar {
public meth1() {
}
public meth2() {
}
} plugin:@typescript-eslint/all
For details about how to configure Code Linter check rules, see Code Linter.