Closed
Description
Follow-up to the conversation between @code-asher and I here.
Premise
During the refactor of src/browser/pages/vscode.ts
, we added a couple functions which take in global values i.e. Document
and I opted for the _
approach to differentiate between the global vs passed in value.
While this works, it doesn't prevent developers from accidentally using the global values in that file.
Idea
Make it so globals can only be used in entry files and move the non-global code to other files that way it's clear you aren't supposed to use globals (and the compiler won't let you even if you try).
We're not sure if this is possible — maybe with ESLint?
But worth exploring to improve the codebase and prevent future bugs.