There are similar questions with this same error message, but every one I found is a runtime error. For me, globalThis does exist at runtime, but ESLint reports that it does not. How do I tell ESLint that globalThis exists?
Note: I created this to answer it myself. I thought it should be documented outside of an obscure github issue.
@mdjermanovic documented the fix here:
Note that you can find older answers that suggest adding
globalThisas an eslint "global" config, but the above solution is a more modern approach.