src/content/docs/linter/rules/use-exports-last.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JavaScript (and super languages)" icon="seti:javascript"> ## Summary - Rule available since: `v2.0.0` - Diagnostic Category: [`lint/style/useExportsLast`](/reference/diagnostics#diagnostic-category) - This rule isn't recommended, so you need to enable it. - This rule doesn't have a fix. - The default severity of this rule is [**information**](/reference/diagnostics#information). - Sources: - Same as [`import/exports-last`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md){
"linter": {
"rules": {
"style": {
"useExportsLast": "error"
}
}
}
}
Require that all exports are declared after all non-export statements.
Enforces that export statements are placed at the end of the module, after all other statements.
export const a = 1;
const b = 2;
const a = 1;
export const b = 2;
const a = 1;
export { a };