noAstroComponentDefaultExport (JavaScript)
Language JavaScript (and super languages)
Summary
Section titled “Summary”- Rule available since:
v2.6.9 - Diagnostic Category:
lint/nursery/noAstroComponentDefaultExport - This rule doesn’t have a fix.
- The default severity of this rule is error.
- This rule belongs to the following domains:
- Sources:
- Inspired from
astro/no-exports-from-components
- Inspired from
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noAstroComponentDefaultExport": "error" } } }}Description
Section titled “Description”Disallow runtime default exports in Astro component frontmatter.
Astro generates the runtime default export for each component. Defining another runtime default export in the component frontmatter conflicts with that generated export. Named exports and type-only default exports are allowed.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”---export default function render() {}---code-block.astro:2:8 lint/nursery/noAstroComponentDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Astro components cannot define a runtime default export.
1 │ ---
> 2 │ export default function render() {}
│ ^^^^^^^
3 │ ---
4 │
ℹ Astro generates the component's runtime default export.
ℹ Remove this export or use a named export instead.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
---export function helper() {}export default interface Props {}---Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.