no-restricted-modules
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-restricted-modules": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
const fs = require('fs');
const cluster = require('cluster');const cluster = require('cluster');const pick = require('lodash/pick');const crypto = require('crypto');/*eslint no-restricted-modules: ["error", {
"paths": ["fs", "cluster"],
"patterns": ["lodash/*", "!lodash/pick"]
}]*/
const crypto = require('crypto');
const pick = require('lodash/pick');Examples from the ESLint documentation.
no-restricted-modules
eslint
export default [
{
rules: {
"no-restricted-modules": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce consistent naming when capturing the current execution context
Disallow use of this in contexts where the value of this is undefined
Enforce a maximum depth that blocks can be nested
Enforce a maximum number of lines per file
Enforce a maximum number of parameters in function definitions
Disallow shorthand type conversions