Skip to content

An ESLint plugin that prohibits importing specified packages

Notifications You must be signed in to change notification settings

ohxxx/eslint-plugin-prohibit-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An ESLint plugin that prohibits importing specified packages

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published