跳转到内容

useExportsLast

此内容尚不支持你的语言。

Diagnostic Category: lint/nursery/useExportsLast

Since: vnext

Sources:

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;
code-block.js:1:1 lint/nursery/useExportsLast ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

All exports should be declared after all non-export statements.

> 1 │ export const a = 1;
^^^^^^^^^^^^^^^^^^^
2 │ const b = 2;
3 │

Move this statement before the export statements to keep all exports at the end of the module.

const a = 1;
export const b = 2;
const a = 1;
export { a };
biome.json
{
"linter": {
"rules": {
"nursery": {
"useExportsLast": "error"
}
}
}
}