# explicit-module-boundary-types

Rule `typescript/explicit-module-boundary-types`. Require explicit return and argument types on exported functions' and classes' public class methods

- Source: typescript
- Technologies: TypeScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1652 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/explicit-module-boundary-types` | no | no | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/explicit-module-boundary-types) |
| Oxlint | `typescript/explicit-module-boundary-types` | no | no | plugin `typescript`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/explicit-module-boundary-types.html) |
| Biome | `nursery/useExplicitType` | no | no | group nursery, since 1.9.3 | [docs](https://biomejs.dev/linter/rules/use-explicit-type/) |

## Code examples

### Incorrect: the rule reports this

```ts
// Should indicate that no value is returned (void)
export function test() {
  return;
}

// Should indicate that a string is returned
export var arrowFn = () => 'test';

// All arguments should be typed
export var arrowFn = (arg): string => `test ${arg}`;
export var arrowFn = (arg: any): string => `test ${arg}`;

export class Test {
  // Should indicate that no value is returned (void)
  method() {
    return;
  }
}
```

### Correct: the rule accepts this

```ts
// A function with no return value (void)
export function test(): void {
  return;
}

// A return value of type string
export var arrowFn = (): string => 'test';

// All arguments should be typed
export var arrowFn = (arg: string): string => `test ${arg}`;
export var arrowFn = (arg: unknown): string => `test ${arg}`;

export class Test {
  // A class method with no return value (void)
  method(): void {
    return;
  }
}

// The function does not apply because it is not an exported function.
function test() {
  return;
}
```

Examples from the ESLint documentation.

## Enable it

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

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/explicit-module-boundary-types": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/explicit-module-boundary-types": "error"
  }
}
```

### Biome: `biome.json`

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

## Related rules

- [typescript/no-invalid-this](https://lintradar.dev/rules/typescript/no-invalid-this.md): Disallow `this` keywords outside of classes or class-like objects
- [typescript/member-ordering](https://lintradar.dev/rules/typescript/member-ordering.md): Require a consistent member declaration order
- [typescript/init-declarations](https://lintradar.dev/rules/typescript/init-declarations.md): Require or disallow initialization in variable declarations
- [typescript/class-methods-use-this](https://lintradar.dev/rules/typescript/class-methods-use-this.md): Enforce that class methods utilize `this`
- [typescript/prefer-destructuring](https://lintradar.dev/rules/typescript/prefer-destructuring.md): Require destructuring from arrays and/or objects
- [typescript/no-magic-numbers](https://lintradar.dev/rules/typescript/no-magic-numbers.md): Disallow magic numbers

---

Web page: https://lintradar.dev/rules/typescript/explicit-module-boundary-types. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
