eslint-plugin-no-ghost-export
v1.0.0
Published
ESLint rule that disallows importing bindings only to re-export them (ghost exports).
Maintainers
Readme
eslint-plugin-no-ghost-export
Disallow ghost exports: importing a binding only to re-export it.
Bad
import { parseJsonl, readFileText } from './openaiBatch.helper.mjs';
export { parseJsonl, readFileText };Good
export { parseJsonl, readFileText } from './openaiBatch.helper.mjs';Using an import locally and also exporting it is allowed.
Install
npm install -D eslint-plugin-no-ghost-exportUsage
Legacy (.eslintrc.*)
{
"plugins": ["no-ghost-export"],
"rules": {
"no-ghost-export/no-ghost-export": "error"
}
}Or:
{
"extends": ["plugin:no-ghost-export/recommended"]
}Flat config (eslint.config.js)
const noGhostExport = require('eslint-plugin-no-ghost-export');
module.exports = [noGhostExport.configs['flat/recommended']];Rule
| Name | Description |
| ----------------- | ------------------------------------- |
| no-ghost-export | Ban imports that are only re-exported |
License
MIT
