---
# Don't modify this file manually. This file is auto generated from source, and you will lose your changes next time the website is built.
# Head to the `biomejs/biome` repository, and modify the source code in there.

title: noDeprecatedImports
description: Learn more about noDeprecatedImports
---
import { Tabs, TabItem } from '@astrojs/starlight/components';

<Tabs>
<TabItem label="JavaScript (and super languages)" icon="seti:javascript">
:::caution
This rule is part of the [nursery](/linter/#nursery) group. This means that it is experimental and the behavior can change at any time.
:::
:::note
This rule belongs to the project domain. This means that its activation will activate the Biome Scanner, which might affect the performance. Read more about it in the [documentation page](/linter/domains#project)
:::
## Summary
- Rule available since: `v2.2.5`
- Diagnostic Category: [`lint/nursery/noDeprecatedImports`](/reference/diagnostics#diagnostic-category)
- This rule doesn't have a fix.
- The default severity of this rule is [**warning**](/reference/diagnostics#warning).
- This rule belongs to the following domains:
  - [`project`](/linter/domains#project)
- Sources: 
  - Inspired from [`@typescript-eslint/no-deprecated`](https://typescript-eslint.io/rules/no-deprecated)
  - Inspired from [`import/no-deprecated`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md)

## How to configure
```json title="biome.json"
{
	"linter": {
		"rules": {
			"nursery": {
				"noDeprecatedImports": "error"
			}
		}
	}
}

```
## Description
Restrict imports of deprecated exports.

This rule flags any imports for symbols (such as types, functions, or
anything else that can be imported), that are documented with a JSDoc
comment that contains an "@deprecated" annotation.

## Examples

### Invalid

```js title='foo.js'
import { oldUtility } from "./utils.js";
```

<pre class="language-text"><code class="language-text"><a href="file:///foo.js">/foo.js</a>:1:10 <a href="https://biomejs.dev/linter/rules/no-deprecated-imports">lint/nursery/noDeprecatedImports</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: Orange;">⚠</span></strong> <span style="color: Orange;">Deprecated import.</span><br />  <br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>1 │ </strong>import &#123; oldUtility &#125; from &quot;./utils.js&quot;;<br />   <strong>   │ </strong>         <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>2 │ </strong><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">An </span><span style="color: lightgreen;"><strong>@deprecated</strong></span><span style="color: lightgreen;"> annotation indicates the author doesn't want you to rely on this import anymore.</span><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">You should probably import a different symbol instead.</span><br />  <br />  <strong><span style="color: lightgreen;">ℹ</span></strong> <span style="color: lightgreen;">This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit </span><span style="color: lightgreen;"><a href="https://biomejs.dev/linter/#nursery">https://biomejs.dev/linter/#nursery</a></span><span style="color: lightgreen;"> for more information.</span><br />  <br /></code></pre>

```js title='utils.js'
/**
 * @deprecated
 */
export function oldUtility() {}
```

### Valid

```js title='foo.js'
import { newUtility, oldUtility } from "./utils.js";
```

```js title='utils.js'
export function newUtility() {}

// @deprecated (this is not a JSDoc comment)
export function oldUtility() {}
```

## Related links

- [Disable a rule](/linter/#disable-a-rule)
- [Configure the code fix](/linter#configure-the-code-fix)
- [Rule options](/linter/#rule-options)
- [Source Code](https://github.com/biomejs/biome/blob/main/crates/biome_js_analyze/src/lint/nursery/no_deprecated_imports.rs)
- [Test Cases](https://github.com/biomejs/biome/blob/main/crates/biome_js_analyze/tests/specs/nursery/noDeprecatedImports)

</TabItem>
</Tabs>