noRestrictedDependencies
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/noRestrictedDependencies - This rule doesn’t have a fix.
- The default severity of this rule is information.
- Sources:
- Same as
e18e/ban-dependencies
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noRestrictedDependencies": "error" } } }}Description
Section titled “Description”Disallow dependencies that are known to have better alternatives.
This rule checks dependencies and devDependencies in package.json
against e18e’s replacement data and suggests modern, native, or more
maintainable alternatives.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”{ "dependencies": { "globby": "x.x.x" }}/package.json:3:5 lint/nursery/noRestrictedDependencies ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Use of the restricted dependency globby detected.
1 │ {
2 │ “dependencies”: {
> 3 │ “globby”: “x.x.x”
│ ^^^^^^^^
4 │ }
5 │ }
ℹ The dependency might be old, not actively maintained, or there’s a native alternative.
ℹ The following replacement is suggested:
- Replace with the alternative: tinyglobby.
ℹ Read more: https://e18e.dev/docs/replacements/globby
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
{ "dependencies": { "tinyglobby": "x.x.x" }}See the e18e docs for the full list of replacements.
Related links
Section titled “Related links”Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/noRestrictedDependencies - This rule doesn’t have a fix.
- The default severity of this rule is information.
- Sources:
- Same as
e18e/ban-dependencies
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noRestrictedDependencies": "error" } } }}Description
Section titled “Description”Disallow dependencies that are known to have better alternatives.
This rule checks static imports, dynamic import(), and require() calls
and suggests modern, native, or more maintainable alternatives based on
e18e’s replacement data.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”import glob from "globby";code-block.js:1:18 lint/nursery/noRestrictedDependencies ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Use of the restricted dependency globby detected.
> 1 │ import glob from “globby”;
│ ^^^^^^^^
2 │
ℹ The dependency might be old, not actively maintained, or there’s a native alternative.
ℹ The following replacement is suggested:
- Replace with the alternative: tinyglobby.
ℹ Read more: https://e18e.dev/docs/replacements/globby
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
const glob = require("globby");code-block.js:1:22 lint/nursery/noRestrictedDependencies ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Use of the restricted dependency globby detected.
> 1 │ const glob = require(“globby”);
│ ^^^^^^^^
2 │
ℹ The dependency might be old, not actively maintained, or there’s a native alternative.
ℹ The following replacement is suggested:
- Replace with the alternative: tinyglobby.
ℹ Read more: https://e18e.dev/docs/replacements/globby
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
const glob = await import("globby");code-block.js:1:27 lint/nursery/noRestrictedDependencies ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Use of the restricted dependency globby detected.
> 1 │ const glob = await import(“globby”);
│ ^^^^^^^^
2 │
ℹ The dependency might be old, not actively maintained, or there’s a native alternative.
ℹ The following replacement is suggested:
- Replace with the alternative: tinyglobby.
ℹ Read more: https://e18e.dev/docs/replacements/globby
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
import glob from "tinyglobby";const glob = require("tinyglobby");const glob = await import("tinyglobby");See the e18e docs for the full list of replacements.
Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.