eslint-plugin-restrict-named-import

npm i -D eslint-plugin-restrict-named-import

Usage no npm install needed!

<script type="module">
  import eslintPluginRestrictNamedImport from 'https://cdn.skypack.dev/eslint-plugin-restrict-named-import';
</script>

README

eslint-plugin-restrict-named-import

Installation

npm i -D eslint-plugin-restrict-named-import
# or
yarn add -D eslint-plugin-restrict-named-import
  • Add settings to .eslintrc.
// ...
  plugins: [
    /** other plugins **/,
    "restrict-named-import"
  ],
  rules: {
    "restrict-named-import/no-specific-named-import": [2, [["foo", "bar"]]]
  },
// ...
  • An error occurs in the following.
import { bar } from 'foo';

// ...

Rules