eslint-plugin-misc

ESLint plugin

This project is maintained by iliubinskii

disallow-import

ESLint plugin / disallow-import

Disallows import given sources.

module.exports = {
  plugins: ["misc"],
  rules: {
    "misc/disallow-import": [
      "error",
      {
        allow: string | string[],
        disallow: string | string[]
      }
    ]
  }
};

| Option | Description | Default | | :—– | :———- | :—— |

allow Allowed sources (minimatch) []
disallow Disallowed sources (minimatch) []

Examples of incorrect code

/*
eslint misc/disallow-import: [
  error,
  {
    disallow: "source1"
  }
]
*/
import * as source1 from "source1";

Examples of correct code

/*
eslint misc/disallow-import: [
  error,
  {
    disallow: "source1"
  }
]
*/
import * as source2 from "source2";