Opinionated, difficult/impossible to implement, and likely super annoying in practice.
Reasoning: importing a file should not have side effects
Related rules:
document.title = 'gone'
export function init () {
document.title = 'gone'
}
function init () {
document.title = 'gone'
}
// Optional? Still a side effect, but at least it's wrapped
// and not lost between many function declarations.
// Maybe a single, unassigned function call per file could be allowed
init();
// Optional? Assignments could be considered side-effect free for the sake of usability
const details = new Map();
const response = fetch(); // even if they're not, really
const memoizedFetch = mem(fetch);
// in ./polyfill.js
// Optional? Some exceptions could be made by filename
document.title = 'gone'
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too