# no-default-export

Rule `import/no-default-export`. Forbid default exports.

- 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: #1657 by reach

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
export default 'bar';

const foo = 'foo';
export { foo as default }
```

### Correct: the rule accepts this

```js
export const foo = 'foo';
export const bar = 'bar';
```

Examples from the Oxlint documentation.

## Enable it

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

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "import"
  ],
  "rules": {
    "import/no-default-export": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "noDefaultExport": "error"
      }
    }
  }
}
```

## Related rules

- [import/no-commonjs](https://lintradar.dev/rules/import/no-commonjs.md): Forbid CommonJS `require` calls and `module.exports` or `exports.*`.
- [import/no-nodejs-modules](https://lintradar.dev/rules/import/no-nodejs-modules.md): Forbid Node.js builtin modules.
- [import/exports-last](https://lintradar.dev/rules/import/exports-last.md): Ensure all exports appear after other statements.
- [import/no-unassigned-import](https://lintradar.dev/rules/import/no-unassigned-import.md): Forbid unassigned imports
- [import/group-exports](https://lintradar.dev/rules/import/group-exports.md): Prefer named exports to be grouped together in a single export declaration
- [import/max-dependencies](https://lintradar.dev/rules/import/max-dependencies.md): Enforce the maximum number of dependencies a module can have.

---

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