---
title: "import/no-named-default"
description: "Disallow `import { default as name }` in favor of `import name`"
# Generated by src/codegen/lint-rule-docs.ts. Do not edit below this line.
plugin: "import"
aliases: ["import-x/no-named-default"]
kind: "suggestion"
category: "style"
default: "off"
fixable: "no"
typeAware: false
deprecated: false
---

`import { default as React } from "react"` and `import React from "react"` do the same thing. The second is shorter, and it's the form readers expect.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"import/no-named-default" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}
```js
import { default as React, useState } from "react";
```

{/* bad */}
```ts
import type { default as User } from "./user";
```

Not reported:

{/* good */}
```js
import React, { useState } from "react";
```

{/* good */}
```ts
import type User from "./user";
```

A name marked with `type` inside the braces isn't reported either:

{/* good */}
```ts
import { type default as User, loadUser } from "./user";
```
