Skip to content

eslint/no-func-assign Correctness

This rule is turned on by default.

What it does

Disallow reassigning function declarations

Why is this bad?

Overwriting/reassigning a function written as a FunctionDeclaration is often indicative of a mistake or issue.

Example

javascript
function foo() {}
foo = bar;

How to use

To enable this rule in the CLI or using the config file, you can use:

bash
oxlint --deny no-func-assign
json
{
  "rules": {
    "no-func-assign": "error"
  }
}

References

Released under the MIT License.