{"record":{"id":"a544df82e91f3450","repo":"oxc-project/oxc","slug":"no-named-exports-found-in-module-module-name","errorCode":null,"errorMessage":"No named exports found in module '{module_name}'","messagePattern":"No named exports found in module '(.+?)'","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/import/export.rs","lineNumber":18,"sourceCode":"use std::path::PathBuf;\n\nuse rustc_hash::{FxHashMap, FxHashSet};\n\nuse oxc_diagnostics::{LabeledSpan, OxcDiagnostic};\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::Span;\nuse oxc_str::CompactStr;\n\nuse crate::{\n    ModuleRecord,\n    context::LintContext,\n    module_record::{ExportEntry, ExportExportName},\n    rule::Rule,\n};\n\nfn no_named_export(module_name: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"No named exports found in module '{module_name}'\"))\n        .with_help(\"Remove the `export *` re-export, or add named exports to the target module.\")\n        .with_label(span)\n}\n\n/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/export.md>\n#[derive(Debug, Default, Clone)]\npub struct Export;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Reports funny business with exports, like repeated exports of names or defaults.\n    ///\n    /// ### Why is this bad?\n    ///\n    /// Having multiple exports of the same name can lead to ambiguity and confusion\n    /// in the codebase. It makes it difficult to track which export is being used\n    /// and can result in runtime errors if the wrong export is referenced.","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/import/export.rs#L1-L36","documentation":"oxlint's `import/export` rule flags `export * from '...'` re-exports whose target module record contains no named exports. Since `export *` never re-exports a target's default export, star-exporting a module with only a default (or nothing named) exports nothing, and the diagnostic names the module.","triggerScenarios":"`export * from './utils';` where utils.ts contains only `export default ...` (or no named exports at all); requires the target module to be resolvable in the same lint run so its export entries can be inspected.","commonSituations":"Index files star-exporting utility modules that were later changed to default-export; scaffolding that adds `export *` boilerplate; a module rewritten to a single default export without updating its consumers' barrels.","solutions":["Re-export the default explicitly: `export { default as helper } from './utils';`","Add named exports to the target module so `export *` has something to propagate","Delete the star export if nothing should be re-exported"],"exampleFix":"// before — utils.ts only has a default export, export * re-exports nothing\n// utils.ts: export default function helper() {}\nexport * from './utils';\n\n// after\nexport { default as helper } from './utils';","handlingStrategy":"validation","validationCode":"// .oxlintrc.json\n{\n  \"plugins\": [\"import\"],\n  \"rules\": { \"import/export\": \"error\" }\n}\n// CI gate: npx oxlint src/ && npx tsc --noEmit","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember export * never re-exports a default — star-exporting a default-only module is a no-op","Prefer explicit re-export lists in barrel files","Review scaffolded index files that add export * boilerplate","Keep the import plugin enabled so star-export targets are checked against their module records"],"tags":["lint","oxlint","import-plugin","esm","modules","exports"],"backgroundTag":"missing-module-export","analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}