sindresorhus/eslint-plugin-unicorn

Rule proposal: `no-exports-in-scripts`

Open

#2,513 建立於 2024年12月18日

在 GitHub 查看
 (3 留言) (3 反應) (0 負責人)JavaScript (5,022 star) (468 fork)user submission
help wantednew rule

描述

Description

Currently, a js file starts with hashbang #! is script file. In script file, using exports is useless and confused.

Fail

#!/usr/bin/env node

export const foo = {};

Pass

export {}
#!/usr/bin/env node

console.log('foo');

Proposed rule name

no-exports-in-scripts

Additional Info

No response

貢獻者指南