ESLint Plugin
npm install --save-dev eslint-plugin-prohibit-import
// Configure in the .eslintrc.js file
module.exports = {
...,
plugins: [
"prohibit-import"
],
rules: {
"prohibit-import/config": [
"error", // Tip Status
{
exclude: ['src/utils'], // Folders to be excluded from inspection
pkgs: ['lodash'], // Name of package to be disabled
fix: true, // Whether to repair automatically, default true
}
]
}
}