Skip to contentSlop Block

no-default-exports

Warning

Use named exports. The rule skips config files and Expo Router routes. Use an ast-grep-ignore comment for any other framework entry point that needs a default export.

export default function Header() {}Replace this default export with a named export
const client = new ApolloClient({});export default client;Replace this default export with a named export
export { client as default };Replace this default export with a named export
// ast-grep-ignore: no-default-exports-typescript

How to fix

Write export function Name() or export const name = ....

The rule skips config files and Expo Router routes because their tools require a default export. If another framework entry point needs a default export, add // ast-grep-ignore: no-default-exports-typescript on the line above with the reason.