import/no-deprecated
eslint-plugin-import
No autofix
eslint.config.js
import importPlugin from "eslint-plugin-import";
export default [
{
plugins: { import: importPlugin },
rules: {
"import/no-deprecated": "error",
},
},
];Forbid imported names marked with @deprecated documentation tag.
import { oldUtility } from "./utils.js";/**
* @deprecated
*/
export function oldUtility() {}import { newUtility, oldUtility } from "./utils.js";export function newUtility() {}
// @deprecated (this is not a JSDoc comment)
export function oldUtility() {}Examples from the Biome documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
import/no-deprecated
eslint-plugin-import
import importPlugin from "eslint-plugin-import";
export default [
{
plugins: { import: importPlugin },
rules: {
"import/no-deprecated": "error",
},
},
];Oxlint does not have this rule.
suspicious/noDeprecatedImports
suspicious · since 2.2.5
{
"linter": {
"rules": {
"suspicious": {
"noDeprecatedImports": "error"
}
}
}
}Disallow using code marked as @deprecated
Enforce either using, or omitting, the node: protocol when importing Node.js builtin modules.
Forbid potentially ambiguous parse goal (script vs. module).
Forbid importing modules from parent directories.