eslint-plugin-no-direct-export-of-imports

npm version

Plugin for disallowing direct export of imports

Fail

import somethingDefault from 'someImport'
export { somethingDefault }

Pass

import somethingDefault from 'someImport'
export { somethingDefault as newNamed }

Installation

You’ll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-no-direct-export-of-imports:

npm install eslint-plugin-no-direct-export-of-imports --save-dev

Usage

Add no-direct-export-of-imports to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "no-direct-export-of-imports"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "no-direct-export-of-imports/no-direct-export-of-imports": "error"
    }
}

GitHub

View Github