import/export
eslint-plugin-import
No autofixRecommended
eslint.config.js
import importPlugin from "eslint-plugin-import";
export default [
{
plugins: { import: importPlugin },
rules: {
"import/export": "error",
},
},
];let foo;
export { foo }; // Multiple exports of name 'foo'.
export * from "./export-all"; // Conflicts if export-all.js also exports foolet foo;
export { foo as foo1 }; // Renamed export to avoid conflict
export * from "./export-all"; // No conflict if export-all.js also exports fooExamples from the Oxlint documentation.
import/export
eslint-plugin-import
import importPlugin from "eslint-plugin-import";
export default [
{
plugins: { import: importPlugin },
rules: {
"import/export": "error",
},
},
];import/export
import plugin · nursery
{
"plugins": [
"import"
],
"rules": {
"import/export": "error"
}
}nursery/noDuplicateExports
nursery · since 2.6.10
{
"linter": {
"rules": {
"nursery": {
"noDuplicateExports": "error"
}
}
}
}Ensure a default export is present, given a default import.
Ensure imported namespaces contain dereferenced properties as they are dereferenced.
Forbid repeated import of the same module in multiple places.
Forbid use of exported name as identifier of default export.
Forbid use of exported name as property of default export.
Ensure named imports correspond to a named export in the remote file.