unicorn/no-exports-in-scripts
eslint-plugin-unicorn
No autofix
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-exports-in-scripts": "error",
},
},
];#!/usr/bin/env node
export const foo = 1;#!/usr/bin/env node
const foo = 1;
console.log(foo);export const foo = 1;Examples from the ESLint documentation.
unicorn/no-exports-in-scripts
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-exports-in-scripts": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Disallow assigning to built-in error properties.
Disallow assigning properties on the global object.
Disallow adjacent duplicate operands in logical expressions.
Disallow impossible comparisons against .length or .size.
Disallow declarations before conditional early exits when they are only used after the exit.
Disallow class accessors that hide an inherited getter or setter.