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

贡献者指南

Rule proposal: `no-exports-in-scripts` · sindresorhus/eslint-plugin-unicorn#2513 | Good First Issue