# no-func-assign

Rule `eslint/no-func-assign`. Disallow reassigning `function` declarations

- Source: eslint
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 278.7M weekly downloads of presets that enable it
- Trend: +45.0% last quarter
- Rank: #17 by reach, #916 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-func-assign` | yes | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-func-assign) |
| Oxlint | `no-func-assign` | yes | no | plugin `eslint`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-func-assign.html) |
| Biome | `suspicious/noFunctionAssign` | yes | no | group suspicious, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/no-function-assign/) |

## Code examples

### Incorrect: the rule reports this

```js
function foo() {}
foo = bar;

function baz() {
    baz = bar;
}

let a = function hello() {
  hello = 123;
};
```

```js
foo = bar;
function foo() {}
```

### Correct: the rule accepts this

```js
let foo = function () {}
foo = bar;

function baz(baz) { // `baz` is shadowed.
    baz = bar;
}

function qux() {
    const qux = bar;  // `qux` is shadowed.
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "no-func-assign": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-func-assign": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "noFunctionAssign": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [ESLint recommended](https://lintradar.dev/presets/eslint-recommended.md) | ESLint | `@eslint/js` | 64 | 178.8M | +25.9% |
| [Oxlint default](https://lintradar.dev/presets/oxlint-default.md) | Oxlint | `oxlint` | 111 | 50.8M | +183.6% |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [React Native](https://lintradar.dev/presets/react-native.md) | ESLint | `@react-native/eslint-config` | 79 | 1.2M | +5.8% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [eslint/no-dupe-keys](https://lintradar.dev/rules/eslint/no-dupe-keys.md): Disallow duplicate keys in object literals
- [eslint/no-obj-calls](https://lintradar.dev/rules/eslint/no-obj-calls.md): Disallow calling global object properties as functions
- [eslint/no-const-assign](https://lintradar.dev/rules/eslint/no-const-assign.md): Disallow reassigning `const`, `using`, and `await using` variables
- [eslint/no-unreachable](https://lintradar.dev/rules/eslint/no-unreachable.md): Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements
- [eslint/no-with](https://lintradar.dev/rules/eslint/no-with.md): Disallow `with` statements
- [eslint/no-debugger](https://lintradar.dev/rules/eslint/no-debugger.md): Disallow the use of `debugger`

---

Web page: https://lintradar.dev/rules/eslint/no-func-assign. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
