# no-named-as-default

Rule `import/no-named-as-default`. Forbid use of exported name as identifier of default export.

- Source: import
- Technologies: Imports
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 92.7M weekly downloads of presets that enable it
- Trend: +30.5% last quarter
- Rank: #196 by reach, #1123 by growth

## Linters

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

## Code examples

### Correct: the rule accepts this

```js
import foo from './foo.js';
```

```js
// message: Using exported name 'bar' as identifier for default export.
import bar from './foo.js';
```

```js
// valid:
export foo from './foo.js';

// message: Using exported name 'bar' as identifier for default export.
export bar from './foo.js';
```

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/no-named-as-default": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [import recommended](https://lintradar.dev/presets/import-recommended.md) | ESLint | `eslint-plugin-import` | 8 | 80.3M | +33.7% |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [import/no-named-as-default-member](https://lintradar.dev/rules/import/no-named-as-default-member.md): Forbid use of exported name as property of default export.
- [import/no-duplicates](https://lintradar.dev/rules/import/no-duplicates.md): Forbid repeated import of the same module in multiple places.
- [import/named](https://lintradar.dev/rules/import/named.md): Ensure named imports correspond to a named export in the remote file.
- [import/no-unresolved](https://lintradar.dev/rules/import/no-unresolved.md): Ensure imports point to a file/module that can be resolved.
- [import/no-anonymous-default-export](https://lintradar.dev/rules/import/no-anonymous-default-export.md): Forbid anonymous values as default exports.
- [import/namespace](https://lintradar.dev/rules/import/namespace.md): Ensure imported namespaces contain dereferenced properties as they are dereferenced.

---

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