# group-exports

Rule `import/group-exports`. Prefer named exports to be grouped together in a single export declaration

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `import/group-exports` | no | no | package `eslint-plugin-import` | [docs](https://github.com/import-js/eslint-plugin-import/blob/v2.32.0/docs/rules/group-exports.md) |
| Oxlint | `import/group-exports` | no | no | plugin `import`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/import/group-exports.html) |

## Code examples

### Incorrect: the rule reports this

```js
// Multiple named export statements -> not ok!
export const first = true
export const second = true
```

```js
// Aggregating exports from the same module -> not ok!
export { module1 } from 'module-1'
export { module2 } from 'module-1'
```

```js
// Multiple exports assignments -> not ok!
exports.first = true
exports.second = true
```

### Correct: the rule accepts this

```js
// A single named export declaration -> ok
export const valid = true
```

```js
const first = true
const second = true

// A single named export declaration -> ok
export {
  first,
  second,
}
```

```js
// Aggregating exports -> ok
export { default as module1 } from 'module-1'
export { default as module2 } from 'module-2'
```

Examples from the ESLint documentation.

## Enable it

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

```js
import importPlugin from "eslint-plugin-import";

export default [
  {
    plugins: { import: importPlugin },
    rules: {
      "import/group-exports": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "import"
  ],
  "rules": {
    "import/group-exports": "error"
  }
}
```

## Related rules

- [import/max-dependencies](https://lintradar.dev/rules/import/max-dependencies.md): Enforce the maximum number of dependencies a module can have.
- [import/no-named-export](https://lintradar.dev/rules/import/no-named-export.md): Forbid named exports.
- [import/no-namespace](https://lintradar.dev/rules/import/no-namespace.md): Forbid namespace (a.k.a. "wildcard" `*`) imports.
- [import/no-relative-parent-imports](https://lintradar.dev/rules/import/no-relative-parent-imports.md): Forbid importing modules from parent directories.
- [import/unambiguous](https://lintradar.dev/rules/import/unambiguous.md): Forbid potentially ambiguous parse goal (`script` vs. `module`).
- [import/enforce-node-protocol-usage](https://lintradar.dev/rules/import/enforce-node-protocol-usage.md): Enforce either using, or omitting, the `node:` protocol when importing Node.js builtin modules.

---

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