sindresorhus/eslint-plugin-unicorn

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

Open

#2.513 geöffnet am 18. Dez. 2024

Auf GitHub ansehen
 (3 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)JavaScript (5.022 Stars) (468 Forks)user submission
help wantednew rule

Beschreibung

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

Contributor Guide