# func-style

Rule `eslint/func-style`. Enforce the consistent use of either `function` declarations or expressions assigned to variables

- Source: eslint
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 2.1M weekly downloads of presets that enable it
- Trend: +151.7% last quarter
- Rank: #1505 by reach, #9 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `func-style` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/func-style) |
| Oxlint | `func-style` | no | no | plugin `eslint`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/func-style.html) |
| Biome | `nursery/useConsistentFunctionStyle` | no | no | group nursery, since 2.5.14 | [docs](https://biomejs.dev/linter/rules/use-consistent-function-style/) |

## Code examples

### Incorrect: the rule reports this

```js
function foo() {
    // ...
}
```

```js
const foo = function() {
    // ...
};

const foo1 = () => {};
```

```ts
const foo = function(): void {};
```

### Correct: the rule accepts this

```js
const foo = function() {
    // ...
};

const foo1 = () => {};

// allowed as allowArrowFunctions : false is applied only for declaration
```

```ts
function process(value: string): string;
function process(value: number): number;
function process(value: unknown) {
    return value;
}
```

```js
function foo() {
    // ...
}

// Methods (functions assigned to objects) are not checked by this rule
SomeObject.foo = function() {
    // ...
};
```

Examples from the ESLint documentation.

## Enable it

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "func-style": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useConsistentFunctionStyle": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |

## Related rules

- [eslint/require-await](https://lintradar.dev/rules/eslint/require-await.md): Disallow async functions which have no `await` expression
- [eslint/id-denylist](https://lintradar.dev/rules/eslint/id-denylist.md): Disallow specified identifiers
- [eslint/id-match](https://lintradar.dev/rules/eslint/id-match.md): Require identifiers to match a specified regular expression
- [eslint/no-duplicate-imports](https://lintradar.dev/rules/eslint/no-duplicate-imports.md): Disallow duplicate module imports
- [eslint/no-inline-comments](https://lintradar.dev/rules/eslint/no-inline-comments.md): Disallow inline comments after code
- [eslint/sort-vars](https://lintradar.dev/rules/eslint/sort-vars.md): Require variables within the same declaration block to be sorted

---

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