Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 793 Bytes

README.md

File metadata and controls

36 lines (31 loc) · 793 Bytes

ESLint Plugin

ESLint Plugin Prohibit Import

An ESLint plugin that detects and fixes prohibited imports to packages within a folder.

Install

npm install --save-dev eslint-plugin-prohibit-import

Configuration

// 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
      }
    ]
  }
}